本文整理汇总了PHP中GFAPI::update_entry_field方法的典型用法代码示例。如果您正苦于以下问题:PHP GFAPI::update_entry_field方法的具体用法?PHP GFAPI::update_entry_field怎么用?PHP GFAPI::update_entry_field使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GFAPI
的用法示例。
在下文中一共展示了GFAPI::update_entry_field方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: upgrade
public function upgrade($previous_version)
{
if (version_compare($previous_version, '1.0.5') == -1) {
$forms = GFAPI::get_forms(true);
foreach ($forms as $form) {
$entries = GFAPI::get_entries($form['id']);
$fields = GFAPI::get_fields_by_type($form, 'repeater');
foreach ($entries as $entry) {
foreach ($fields as $field) {
if (array_key_exists($field['id'], $entry)) {
$dataArray = GFFormsModel::unserialize($entry[$field['id']]);
$dataUpdated = false;
if (!is_array($dataArray)) {
continue;
}
foreach ($dataArray as $repeaterChildId => $repeaterChild) {
foreach ($repeaterChild as $repeatedFieldId => $repeatedField) {
if (!is_array($repeatedField)) {
if ($repeatedField !== '[gfRepeater-section]') {
$dataUpdated = true;
$dataArray[$repeaterChildId][$repeatedFieldId] = array($repeatedField);
}
} elseif (reset($repeatedField) == '[gfRepeater-section]') {
$dataUpdated = true;
$dataArray[$repeaterChildId][$repeatedFieldId] = reset($repeatedField);
}
}
}
if ($dataUpdated) {
GFAPI::update_entry_field($entry['id'], $field['id'], maybe_serialize($dataArray));
}
}
}
}
}
}
}
示例2: delete_passwords
public static function delete_passwords($entry, $form)
{
$password_fields = GFAPI::get_fields_by_type($form, array('password'));
foreach ($password_fields as $password_field) {
GFAPI::update_entry_field($entry['id'], $password_field['id'], '');
}
}
示例3: delete_signature
/**
* Initiates deletion of the signature file and updates the entry to remove the filename.
*
* @param integer $lead_id The ID of the current entry.
* @param integer $field_id The ID of the current field.
*
* @return bool
*/
public function delete_signature($lead_id, $field_id)
{
global $wpdb;
$lead = RGFormsModel::get_lead($lead_id);
$this->delete_signature_file(rgar($lead, $field_id));
return GFAPI::update_entry_field($lead_id, $field_id, '');
}
示例4: update_entry_field
public static function update_entry_field($entry, $form)
{
if ($form['id'] == self::$formID) {
GFAPI::update_entry_field($entry['id'], self::$fieldID, self::decrypt(rgar($entry, self::$fieldID)));
}
}