當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GFAPI::update_entry_field方法代碼示例

本文整理匯總了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));
                         }
                     }
                 }
             }
         }
     }
 }
開發者ID:kodie,項目名稱:gravityforms-repeater,代碼行數:37,代碼來源:repeater.php

示例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'], '');
     }
 }
開發者ID:TMBR,項目名稱:johnjohn,代碼行數:7,代碼來源:class-gf-field-password.php

示例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, '');
 }
開發者ID:wp-premium,項目名稱:gravityformssignature,代碼行數:15,代碼來源:class-gf-signature.php

示例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)));
     }
 }
開發者ID:RadGH,項目名稱:WordPress-Sports-Theme,代碼行數:6,代碼來源:class_contactForm.php


注:本文中的GFAPI::update_entry_field方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。