• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP gform_get_meta函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中gform_get_meta函数的典型用法代码示例。如果您正苦于以下问题:PHP gform_get_meta函数的具体用法?PHP gform_get_meta怎么用?PHP gform_get_meta使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了gform_get_meta函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: set_post_content

function set_post_content($entry, $form)
{
    //$headers[] = "Content-type: text/html";
    $pending_meta_value = gform_get_meta($entry["id"], "is_pending");
    if ($pending_meta_value == "1") {
        // wp_mail('[email protected]', 'Form has been saved', print_r($entry, true), $headers);
        $entry["orderStatus"] = "incomplete";
        $output = GFAPI::update_entry($entry, $entry["id"]);
    } else {
        $entry["orderStatus"] = "complete";
        $entry["unique_id"] = guid();
        //wp_mail('[email protected]', 'Getting the Gravity Form Field IDs', print_r($entry, true), $headers);
        //wp_mail('[email protected]', 'Getting the Gravity Form Data', print_r($form, true), $headers);
        $output = GFAPI::update_entry($entry, $entry["id"]);
        global $wpdb;
        //look up row in lead table, update asic status and update with eCompanies order number.
        $update = $wpdb->query($wpdb->prepare("UPDATE wp_rg_lead SET unique_id='" . $entry["unique_id"] . "' WHERE id=" . $entry['id'] . " AND form_id=" . $entry['form_id']));
        // wp_mail('[email protected]', 'Getting the Gravity Form Field IDs', print_r($update, true), $headers);
    }
}
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:20,代码来源:functions.php


示例2: entry_info

 /**
  * Render entry info of the specified form and lead
  *
  * @param string $form_id
  * @param array $lead
  */
 public static function entry_info($form_id, $lead)
 {
     $payment_id = gform_get_meta($lead['id'], 'pronamic_payment_id');
     if ($payment_id) {
         printf('<a href="%s">%s</a>', esc_attr(get_edit_post_link($payment_id)), esc_html(get_the_title($payment_id)));
     }
 }
开发者ID:wp-pay-extensions,项目名称:gravityforms,代码行数:13,代码来源:Admin.php


示例3: get_pronamic_gf_pay_feed_by_entry_id

function get_pronamic_gf_pay_feed_by_entry_id($entry_id)
{
    $feed_id = gform_get_meta($entry_id, 'ideal_feed_id');
    if (!empty($feed_id)) {
        return new Pronamic_WP_Pay_Extensions_GravityForms_PayFeed($feed_id);
    }
    return null;
}
开发者ID:daanbakker1995,项目名称:vanteun,代码行数:8,代码来源:functions.php


示例4: entry_info_link_to_salesforce

 function entry_info_link_to_salesforce($form_id, $lead)
 {
     $salesforce_id = gform_get_meta($lead['id'], 'salesforce_id');
     if (!empty($salesforce_id)) {
         echo sprintf(__('Salesforce ID: <a href="https://na9.salesforce.com/' . $salesforce_id . '">%s</a><br /><br />', 'gravity-forms-salesforce'), $salesforce_id);
     }
 }
开发者ID:rongandat,项目名称:cyarevfoods,代码行数:7,代码来源:salesforce-api.php


示例5: admin_update_payment

 public static function admin_update_payment($form, $lead_id)
 {
     check_admin_referer('gforms_save_entry', 'gforms_save_entry');
     //update payment information in admin, need to use this function so the lead data is updated before displayed in the sidebar info section
     //check meta to see if this entry is paypal
     $payment_gateway = gform_get_meta($lead_id, "payment_gateway");
     $form_action = strtolower(rgpost("save"));
     if ($payment_gateway != "paypal" || $form_action != "update") {
         return;
     }
     //get lead
     $lead = RGFormsModel::get_lead($lead_id);
     //get payment fields to update
     $payment_status = rgpost("payment_status");
     //when updating, payment status may not be editable, if no value in post, set to lead payment status
     if (empty($payment_status)) {
         $payment_status = $lead["payment_status"];
     }
     $payment_amount = rgpost("payment_amount");
     $payment_transaction = rgpost("paypal_transaction_id");
     $payment_date = rgpost("payment_date");
     if (empty($payment_date)) {
         $payment_date = gmdate("y-m-d H:i:s");
     } else {
         //format date entered by user
         $payment_date = date("Y-m-d H:i:s", strtotime($payment_date));
     }
     global $current_user;
     $user_id = 0;
     $user_name = "System";
     if ($current_user && ($user_data = get_userdata($current_user->ID))) {
         $user_id = $current_user->ID;
         $user_name = $user_data->display_name;
     }
     $lead["payment_status"] = $payment_status;
     $lead["payment_amount"] = $payment_amount;
     $lead["payment_date"] = $payment_date;
     $lead["transaction_id"] = $payment_transaction;
     // if payment status does not equal approved or the lead has already been fulfilled, do not continue with fulfillment
     if ($payment_status == 'Approved' && !$lead["is_fulfilled"]) {
         //call fulfill order, mark lead as fulfilled
         self::fulfill_order($lead, $payment_transaction, $payment_amount);
         $lead["is_fulfilled"] = true;
     }
     //update lead, add a note
     RGFormsModel::update_lead($lead);
     RGFormsModel::add_note($lead["id"], $user_id, $user_name, sprintf(__("Payment information was manually updated. Status: %s. Amount: %s. Transaction Id: %s. Date: %s", "gravityforms"), $lead["payment_status"], GFCommon::to_money($lead["payment_amount"], $lead["currency"]), $payment_transaction, $lead["payment_date"]));
 }
开发者ID:bryanmonzon,项目名称:jenjonesdirect,代码行数:48,代码来源:paypal.php


示例6: get_active_config

 public static function get_active_config($form, $lead = false)
 {
     require_once self::get_base_path() . "/data.php";
     $config = false;
     // if lead is provided, attempt to retrieve config from lead meta
     if (isset($lead['id'])) {
         $config_id = gform_get_meta($lead['id'], 'user_registration_feed_id');
         $config = GFUserData::get_feed($config_id);
     }
     // if no lead is provided or if meta retrieval fails, get all feeds and find the first feed that matches
     if (!$config) {
         $configs = GFUserData::get_feeds_by_form($form["id"]);
         if (!$configs) {
             return false;
         }
         foreach ($configs as $cnfg) {
             if (self::registration_condition_met($form, $cnfg, $lead)) {
                 $config = $cnfg;
                 break;
             }
         }
     }
     // if lead is provided and a config is found, update lead meta with config ID
     if (isset($lead['id']) && $config && !$config_id) {
         gform_update_meta($lead['id'], 'user_registration_feed_id', $config['id']);
     }
     if ($config) {
         return $config;
     }
     return false;
 }
开发者ID:Inteleck,项目名称:hwc,代码行数:31,代码来源:userregistration.php


示例7: is_payment_gateway

 protected function is_payment_gateway($entry_id)
 {
     if ($this->is_payment_gateway) {
         return true;
     }
     $gateway = gform_get_meta($entry_id, 'payment_gateway');
     return $gateway == $this->_slug;
 }
开发者ID:kidaak,项目名称:gravityforms,代码行数:8,代码来源:class-gf-payment-addon.php


示例8: paypal_track_form_post_ipn

 /**
  * Handle the IPN response for pushing the event
  * 
  * @since 1.4.0
  * @param array $post_object global post array from the IPN
  * @param array $entry Gravity Forms entry object
  */
 public function paypal_track_form_post_ipn($post_object, $entry)
 {
     // Check if the payment was completed before continuing
     if (strtolower($entry['payment_status']) != 'paid') {
         return;
     }
     $form = GFFormsModel::get_form_meta($entry['form_id']);
     $ga_event_data = maybe_unserialize(gform_get_meta($entry['id'], 'ga_event_data'));
     // Override this coming from paypal IPN
     $_COOKIE['_ga'] = $ga_event_data['ga_cookie'];
     // Push the event to google
     $this->push_event($entry, $form, $ga_event_data);
 }
开发者ID:resoundcreative-dev,项目名称:wordpress-gravity-forms-event-tracking,代码行数:20,代码来源:class-gravity-forms-event-tracking-feed.php


示例9: get_product_fields

 public static function get_product_fields($form, $lead, $use_choice_text = false, $use_admin_label = false)
 {
     $products = array();
     $product_info = null;
     // retrieve static copy of product info (only for "real" entries)
     if (!rgempty("id", $lead)) {
         $product_info = gform_get_meta(rgar($lead, 'id'), "gform_product_info_{$use_choice_text}_{$use_admin_label}");
     }
     // if no static copy, generate from form/lead info
     if (!$product_info) {
         foreach ($form["fields"] as $field) {
             $id = $field["id"];
             $lead_value = RGFormsModel::get_lead_field_value($lead, $field);
             $quantity_field = self::get_product_fields_by_type($form, array("quantity"), $id);
             $quantity = sizeof($quantity_field) > 0 && !RGFormsModel::is_field_hidden($form, $quantity_field[0], array(), $lead) ? RGFormsModel::get_lead_field_value($lead, $quantity_field[0]) : 1;
             switch ($field["type"]) {
                 case "product":
                     //ignore products that have been hidden by conditional logic
                     $is_hidden = RGFormsModel::is_field_hidden($form, $field, array(), $lead);
                     if ($is_hidden) {
                         continue;
                     }
                     //if single product, get values from the multiple inputs
                     if (is_array($lead_value)) {
                         $product_quantity = sizeof($quantity_field) == 0 && !rgar($field, "disableQuantity") ? rgget($id . ".3", $lead_value) : $quantity;
                         if (empty($product_quantity)) {
                             continue;
                         }
                         if (!rgget($id, $products)) {
                             $products[$id] = array();
                         }
                         $products[$id]["name"] = $use_admin_label && !rgempty("adminLabel", $field) ? $field["adminLabel"] : $lead_value[$id . ".1"];
                         $products[$id]["price"] = $lead_value[$id . ".2"];
                         $products[$id]["quantity"] = $product_quantity;
                     } else {
                         if (!empty($lead_value)) {
                             if (empty($quantity)) {
                                 continue;
                             }
                             if (!rgar($products, $id)) {
                                 $products[$id] = array();
                             }
                             if ($field["inputType"] == "price") {
                                 $name = $field["label"];
                                 $price = $lead_value;
                             } else {
                                 list($name, $price) = explode("|", $lead_value);
                             }
                             $products[$id]["name"] = !$use_choice_text ? $name : RGFormsModel::get_choice_text($field, $name);
                             $products[$id]["price"] = $price;
                             $products[$id]["quantity"] = $quantity;
                             $products[$id]["options"] = array();
                         }
                     }
                     if (isset($products[$id])) {
                         $options = self::get_product_fields_by_type($form, array("option"), $id);
                         foreach ($options as $option) {
                             $option_value = RGFormsModel::get_lead_field_value($lead, $option);
                             $option_label = empty($option["adminLabel"]) ? $option["label"] : $option["adminLabel"];
                             if (is_array($option_value)) {
                                 foreach ($option_value as $value) {
                                     $option_info = self::get_option_info($value, $option, $use_choice_text);
                                     if (!empty($option_info)) {
                                         $products[$id]["options"][] = array("field_label" => rgar($option, "label"), "option_name" => rgar($option_info, "name"), "option_label" => $option_label . ": " . rgar($option_info, "name"), "price" => rgar($option_info, "price"));
                                     }
                                 }
                             } else {
                                 if (!empty($option_value)) {
                                     $option_info = self::get_option_info($option_value, $option, $use_choice_text);
                                     $products[$id]["options"][] = array("field_label" => rgar($option, "label"), "option_name" => rgar($option_info, "name"), "option_label" => $option_label . ": " . rgar($option_info, "name"), "price" => rgar($option_info, "price"));
                                 }
                             }
                         }
                     }
                     break;
             }
         }
         $shipping_field = self::get_fields_by_type($form, array("shipping"));
         $shipping_price = $shipping_name = "";
         if (!empty($shipping_field) && !RGFormsModel::is_field_hidden($form, $shipping_field[0], array(), $lead)) {
             $shipping_price = RGFormsModel::get_lead_field_value($lead, $shipping_field[0]);
             $shipping_name = $shipping_field[0]["label"];
             if ($shipping_field[0]["inputType"] != "singleshipping") {
                 list($shipping_method, $shipping_price) = explode("|", $shipping_price);
                 $shipping_name = $shipping_field[0]["label"] . " ({$shipping_method})";
             }
         }
         $shipping_price = self::to_number($shipping_price);
         $product_info = array("products" => $products, "shipping" => array("name" => $shipping_name, "price" => $shipping_price));
         $product_info = apply_filters("gform_product_info_{$form["id"]}", apply_filters("gform_product_info", $product_info, $form, $lead), $form, $lead);
         // save static copy of product info (only for "real" entries)
         if (!rgempty("id", $lead) && !empty($product_info["products"])) {
             gform_update_meta($lead['id'], "gform_product_info_{$use_choice_text}_{$use_admin_label}", $product_info);
         }
     }
     return $product_info;
 }
开发者ID:ipman3,项目名称:Mediassociates-wp,代码行数:97,代码来源:common.php


示例10: add_entry_approved_hidden_input

 public static function add_entry_approved_hidden_input($form_id, $field_id, $value, $entry, $query_string)
 {
     if (!GVCommon::has_cap('gravityview_moderate_entries', $entry['id'])) {
         return;
     }
     if (empty($entry['id'])) {
         return;
     }
     if (gform_get_meta($entry['id'], 'is_approved')) {
         echo '<input type="hidden" class="entry_approved" id="entry_approved_' . $entry['id'] . '" value="true" />';
     }
 }
开发者ID:qqz,项目名称:GravityView,代码行数:12,代码来源:class-admin-approve-entries.php


示例11: pdf_download_link

function pdf_download_link($text, $form, $entry, $url_encode, $esc_html, $nl2br, $format)
{
    $custom_merge_tag = '{pdf_download_link}';
    if (strpos($text, $custom_merge_tag) === false) {
        return $text;
    }
    $download_link = gform_get_meta($entry['id'], 'gf_pdf_url');
    $download_link = "<a href='{$download_link}'> Download PDF Here</a>";
    $text = str_replace($custom_merge_tag, $download_link, $text);
    return $text;
}
开发者ID:rposborne,项目名称:gravityformspdf,代码行数:11,代码来源:pdf.php


示例12: gformAfterUpdateEntry

 /**
  * update payment status if it has changed
  * @param array $form
  * @param int $lead_id
  */
 public function gformAfterUpdateEntry($form, $lead_id)
 {
     // make sure we have permission
     check_admin_referer('gforms_save_entry', 'gforms_save_entry');
     // check that save action is for update
     if (strtolower(rgpost('save')) != 'update') {
         return;
     }
     // make sure payment is one of ours (probably)
     $payment_gateway = gform_get_meta($lead_id, 'payment_gateway');
     if (empty($payment_gateway) && GFEwayPlugin::isEwayForm($form['id'], $form['fields']) || $payment_gateway != 'gfeway') {
         return;
     }
     // make sure we have a new payment status
     $payment_status = rgpost('payment_status');
     if (empty($payment_status)) {
         return;
     }
     // update payment status
     $lead = GFFormsModel::get_lead($lead_id);
     $lead['payment_status'] = $payment_status;
     GFFormsModel::update_lead($lead);
 }
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:28,代码来源:class.GFEwayAdmin.php


示例13: export_entries_add_values

 /**
  * Populate meta field values when exporting entries
  * @param  string $value    Value of the field being exported
  * @param  int $form_id     ID of the current form.
  * @param  int $field_id    ID of the current field.
  * @param  object $lead     The current entry.
  * @return string
  */
 public static function export_entries_add_values($value, $form_id, $field_id, $lead)
 {
     switch ($field_id) {
         case 'salesforce_id':
             $value = gform_get_meta($lead['id'], 'salesforce_id');
             break;
         case 'salesforce_api_result':
             $value = gform_get_meta($lead['id'], 'salesforce_api_result');
             break;
     }
     return $value;
 }
开发者ID:AgilData,项目名称:WordPress-Skeleton,代码行数:20,代码来源:salesforce-api.php


示例14: paypal_fulfillment

 public static function paypal_fulfillment($entry, $config, $transaction_id, $amount)
 {
     //has this entry been already subscribed?
     $is_subscribed = gform_get_meta($entry["id"], "mailchimp_is_subscribed");
     if (!$is_subscribed) {
         $form = RGFormsModel::get_form_meta($entry['form_id']);
         self::export($entry, $form, true);
     }
 }
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:9,代码来源:mailchimp.php


示例15: cancel_subscription

 private static function cancel_subscription($lead)
 {
     $lead["payment_status"] = "Canceled";
     RGFormsModel::update_lead($lead);
     //loading data class
     $feed_id = gform_get_meta($lead["id"], "authorize.net_feed_id");
     require_once self::get_base_path() . "/data.php";
     $config = GFAuthorizeNetData::get_feed($feed_id);
     if (!$config) {
         return;
     }
     //1- delete post or mark it as a draft based on configuration
     if (rgars($config, "meta/update_post_action") == "draft" && !rgempty("post_id", $lead)) {
         $post = get_post($lead["post_id"]);
         $post->post_status = 'draft';
         wp_update_post($post);
     } else {
         if (rgars($config, "meta/update_post_action") == "delete" && !rgempty("post_id", $lead)) {
             wp_delete_post($lead["post_id"]);
         }
     }
     //2- call subscription canceled hook
     do_action("gform_subscription_canceled", $lead, $config, $lead["transaction_id"], "authorize.net");
 }
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:24,代码来源:authorizenet.php


示例16: is_valid_initial_payment_amount

 private function is_valid_initial_payment_amount($entry_id, $amount_paid)
 {
     //get amount initially sent to paypal
     $amount_sent = gform_get_meta($entry_id, 'payment_amount');
     if (empty($amount_sent)) {
         return true;
     }
     $epsilon = 1.0E-5;
     $is_equal = abs(floatval($amount_paid) - floatval($amount_sent)) < $epsilon;
     $is_greater = floatval($amount_paid) > floatval($amount_sent);
     //initial payment is valid if it is equal to or greater than product/subscription amount
     if ($is_equal || $is_greater) {
         return true;
     }
     return false;
 }
开发者ID:chawlie,项目名称:goldenrollers,代码行数:16,代码来源:class-gf-paypal.php


示例17: localize_script_prso_pluploader_entries

 /**
  * localize_script_prso_pluploader_entries
  * 
  * Called by $this->enqueue_scripts().
  * Localizes some variables for use in a js script that adds a file delete option
  * to the entry post edit page and warns users of file deletion when sending an entry to the trash
  * 
  * @access 	public
  * @author	Ben Moody
  */
 private function localize_script_prso_pluploader_entries()
 {
     //Init vars
     $input_field = NULL;
     $message = __("NOT deleting uploaded files. To delete any uploaded files, be sure to check Delete Uploads", "prso-gforms-plupload");
     $delete_files = NULL;
     $entry_id = NULL;
     //Set the checkbox input field html
     $input_field = '<div style="padding:10px 10px 10px 0;"><input id="prso_pluploader_delete_uploads" type="checkbox" onclick="" name="prso_pluploader_delete_uploads"><label for="prso_fineup_delete_uploads">&nbsp;' . __("Delete All Uploaded Files", "prso-gforms-plupload") . '</label></div>';
     //Get entry meta for delete files option
     if (isset($_GET['lid'])) {
         $entry_id = (int) $_GET['lid'];
     }
     $delete_files = gform_get_meta($entry_id, self::$delete_files_meta_key);
     wp_localize_script('prso-pluploader-entries', 'prso_gforms_pluploader', array('file_delete_message' => $message, 'file_delete_meta' => esc_attr($delete_files), 'input_field_html' => $input_field));
 }
开发者ID:alvarpoon,项目名称:aeg,代码行数:26,代码来源:class.core.init-uploader.php


示例18: gform_update_meta

 /**
  * gform update meta
  *
  * @param $entry_id
  * @param $meta_key
  * @param $meta_value
  *
  * @since
  */
 public function gform_update_meta($entry_id, $meta_key, $meta_value)
 {
     global $wpdb, $_gform_lead_meta;
     $table_name = RGFormsModel::get_lead_meta_table_name();
     $meta_value = maybe_serialize($meta_value);
     $meta_exists = gform_get_meta($entry_id, $meta_key) !== false;
     if ($meta_exists) {
         $wpdb->update($table_name, array('meta_value' => $meta_value), array('lead_id' => $entry_id, 'meta_key' => $meta_key), array('%s'), array('%d', '%s'));
     } else {
         $wpdb->insert($table_name, array('lead_id' => $entry_id, 'meta_key' => $meta_key, 'meta_value' => $meta_value), array('%d', '%s', '%s'));
     }
     //updates cache
     $cache_key = $entry_id . '_' . $meta_key;
     if (array_key_exists($cache_key, $_gform_lead_meta)) {
         $_gform_lead_meta[$cache_key] = maybe_unserialize($meta_value);
     }
 }
开发者ID:chandra-patel,项目名称:rtbiz,代码行数:26,代码来源:class-rt-importer.php


示例19: refresh_product_cache

 public static function refresh_product_cache($form, $lead, $use_choice_text = false, $use_admin_label = false)
 {
     $cache_options = array(array(false, false), array(false, true), array(true, false), array(true, true));
     foreach ($form["fields"] as $field) {
         if (GFCommon::has_field_calculation($field)) {
             //deleting field value cache for calculated fields
             $cache_key = "GFFormsModel::get_lead_field_value_" . $lead["id"] . "_" . $field["id"];
             GFCache::delete($cache_key);
         }
     }
     foreach ($cache_options as $cache_option) {
         list($use_choice_text, $use_admin_label) = $cache_option;
         if (gform_get_meta(rgar($lead, 'id'), "gform_product_info_{$use_choice_text}_{$use_admin_label}")) {
             gform_delete_meta(rgar($lead, 'id'), "gform_product_info_{$use_choice_text}_{$use_admin_label}");
             GFCommon::get_product_fields($form, $lead, $use_choice_text, $use_admin_label);
         }
     }
 }
开发者ID:ascarius,项目名称:wordpress-bootstrap,代码行数:18,代码来源:forms_model.php


示例20: is_entry_approved

 /**
  * Check if a certain entry is approved.
  *
  * If we pass the View settings ($args) it will check the 'show_only_approved' setting before
  *   checking the entry approved field, returning true if show_only_approved = false.
  *
  * @since 1.7
  *
  * @param array $entry  Entry object
  * @param array $args   View settings (optional)
  *
  * @return bool
  */
 public static function is_entry_approved($entry, $args = array())
 {
     if (empty($entry['id']) || array_key_exists('show_only_approved', $args) && !$args['show_only_approved']) {
         // is implicitly approved if entry is null or View settings doesn't require to check for approval
         return true;
     }
     $is_approved = gform_get_meta($entry['id'], 'is_approved');
     if ($is_approved) {
         return true;
     }
     return false;
 }
开发者ID:kidaak,项目名称:GravityView,代码行数:25,代码来源:class-frontend-views.php



注:本文中的gform_get_meta函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP gform_get_meta_values_for_entries函数代码示例发布时间:2022-05-15
下一篇:
PHP gform_delete_meta函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap