当前位置: 首页>>代码示例>>PHP>>正文


PHP RGForms::get方法代码示例

本文整理汇总了PHP中RGForms::get方法的典型用法代码示例。如果您正苦于以下问题:PHP RGForms::get方法的具体用法?PHP RGForms::get怎么用?PHP RGForms::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RGForms的用法示例。


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

示例1: admin_init

 public function admin_init()
 {
     if ('gf_edit_forms' == RGForms::get('page') && 1 == count($_GET)) {
         $this->show_page_on_form_list();
         add_filter('gform_noconflict_scripts', array($this, 'gform_noconflict_scripts'));
     }
 }
开发者ID:jbeyta,项目名称:joelandsam,代码行数:7,代码来源:show-page-on-form-list.php

示例2: settings_page

    public static function settings_page()
    {
        $addon_name = RGForms::get("addon");
        $icon_path = empty($addon_name) ? "" : self::$addon_pages[$addon_name]["icon"];
        $page_title = empty($addon_name) ? __("Gravity Forms Settings", "gravityforms") : $addon_name . " " . __("Settings", "gravityforms");
        $icon_path = empty($icon_path) ? GFCommon::get_base_url() . "/images/gravity-settings-icon-32.png" : $icon_path;
        echo GFCommon::get_remote_message();
        ?>
        <link rel="stylesheet" href="<?php 
        echo GFCommon::get_base_url();
        ?>
/css/admin.css" />
        <div class="wrap">
            <img alt="<?php 
        $page_title;
        ?>
" src="<?php 
        echo $icon_path;
        ?>
" style="float:left; margin:15px 7px 0 0;"/>
            <h2><?php 
        echo $page_title;
        ?>
</h2>

        <?php 
        if (!empty(self::$addon_pages)) {
            ?>
            <ul class="subsubsub">
                <li><a href="?page=gf_settings">Gravity Forms</a> |</li>
            <?php 
            $count = sizeof(self::$addon_pages);
            for ($i = 0; $i < $count; $i++) {
                $addon_keys = array_keys(self::$addon_pages);
                $addon = $addon_keys[$i];
                ?>
                <li><a href="?page=gf_settings&addon=<?php 
                echo urlencode($addon);
                ?>
"><?php 
                echo esc_html($addon);
                ?>
</a> <?php 
                echo $i < $count - 1 ? "|" : "";
                ?>
</li>
                <?php 
            }
            ?>
            </ul>
            <br style="clear:both;"/>
            <?php 
        }
        if (empty($addon_name)) {
            self::gravityforms_settings_page();
        } else {
            do_action("gform_settings_" . str_replace(" ", "_", $addon_name));
        }
    }
开发者ID:hypenotic,项目名称:slowfood,代码行数:59,代码来源:settings.php

示例3: admin_init

 public function admin_init()
 {
     if ('gf_edit_forms' == RGForms::get('page') && '' == rgget('view') && is_numeric(rgget('id'))) {
         add_filter('gform_toolbar_menu', array($this, 'gform_toolbar_menu'), 10, 2);
         add_action('gform_editor_js', array($this, 'gform_editor_js'));
         add_filter('gform_noconflict_scripts', array($this, 'gform_noconflict_scripts'));
     }
 }
开发者ID:jbeyta,项目名称:joelandsam,代码行数:8,代码来源:toggle-all-fields-required.php

示例4: add_field_option

 public function add_field_option()
 {
     if (is_admin() && 'gf_edit_forms' == RGForms::get('page')) {
         add_action('gform_field_advanced_settings', array($this, 'gform_field_advanced_settings'), 10, 2);
         add_filter('gform_tooltips', array($this, 'gform_tooltips'));
         add_action('gform_editor_js', array($this, 'gform_editor_js'));
         add_filter('gform_noconflict_scripts', array($this, 'gform_noconflict_scripts'));
     }
 }
开发者ID:jbeyta,项目名称:joelandsam,代码行数:9,代码来源:redact.php

示例5: settings_page

 public static function settings_page()
 {
     if (class_exists('RGForms') && RGForms::get("page") == "gf_settings") {
         /* 
          * Tell Gravity Forms to initiate our settings page
          * Using the following Class/Model
          */
         RGForms::add_settings_page('PDF', array(self::$model, 'gfpdf_settings_page'));
     }
 }
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:10,代码来源:pdf-settings.php

示例6: __construct

 /**
  * Constructor: setup callbacks and plugin-specific options
  *
  * @author James Inman
  */
 public function __construct()
 {
     parent::__construct();
     // Set the plugin's Clockwork SMS menu to load the contact forms
     $this->plugin_callback = array($this, 'clockwork_gravityforms');
     $this->plugin_dir = basename(dirname(__FILE__));
     // Convert the old settings
     $this->convert_old_settings();
     // Setup all forms into a local variable
     if (!class_exists('RGForms')) {
         require_once dirname(dirname(__FILE__)) . '/gravityforms/gravityforms.php';
     }
     if (!class_exists('RGFormsModel')) {
         require_once dirname(dirname(__FILE__)) . '/gravityforms/forms_model.php';
     }
     $active = RGForms::get('active') == '' ? null : RGForms::get('active');
     $this->forms = RGFormsModel::get_forms($active, 'title');
     // Options and callbacks
     add_action('gform_post_submission', array(&$this, 'do_form_processing'), 10, 2);
 }
开发者ID:jekv,项目名称:devia,代码行数:25,代码来源:main.php

示例7: all_leads_page

 public static function all_leads_page()
 {
     if (!GFCommon::ensure_wp_version()) {
         return;
     }
     $forms = RGFormsModel::get_forms(null, "title");
     $id = RGForms::get("id");
     if (sizeof($forms) == 0) {
         ?>
         <div style="margin:50px 0 0 10px;">
             <?php 
         echo sprintf(__("You don't have any active forms. Let's go %screate one%s", "gravityforms"), '<a href="?page=gf_new_form">', '</a>');
         ?>
         </div>
         <?php 
     } else {
         if (empty($id)) {
             $id = $forms[0]->id;
         }
         self::leads_page($id);
     }
 }
开发者ID:sashadt,项目名称:wp-deploy-test,代码行数:22,代码来源:entry_list.php

示例8: all_leads_page

    public static function all_leads_page()
    {
        if (!GFCommon::ensure_wp_version()) {
            return;
        }
        $forms = RGFormsModel::get_forms(null, 'title');
        $form_id = RGForms::get('id');
        if (sizeof($forms) == 0) {
            ?>
			<div style="margin:50px 0 0 10px;">
				<?php 
            echo sprintf(esc_html__("You don't have any active forms. Let's go %screate one%s", 'gravityforms'), '<a href="?page=gf_new_form">', '</a>');
            ?>
			</div>
			<?php 
        } else {
            if (empty($form_id)) {
                $form_id = $forms[0]->id;
            }
            /**
             * Fires before the entry list content is generated.
             *
             * Echoed content would appear above the page title.
             *
             * int $form_id The ID of the form the entry list is being displayed for.
             */
            do_action('gform_pre_entry_list', $form_id);
            self::leads_page($form_id);
            /**
             * Fires after the entry list content is generated.
             *
             * Echoed content would appear after the bulk actions/paging links below the entry list table.
             *
             * int $form_id The ID of the form the entry list is being displayed for.
             */
            do_action('gform_post_entry_list', $form_id);
        }
    }
开发者ID:kidaak,项目名称:gravityforms,代码行数:38,代码来源:entry_list.php

示例9: is_user_registration_page

 private static function is_user_registration_page()
 {
     $current_page = trim(strtolower(RGForms::get("page")));
     return in_array($current_page, array("gf_user_registration"));
 }
开发者ID:Inteleck,项目名称:hwc,代码行数:5,代码来源:userregistration.php

示例10: calculate_get_entries_criteria

 /**
  * Calculates the Search Criteria used on the self::get_entries / self::get_entry methods
  *
  * @since 1.7.4
  *
  * @param null $passed_criteria array Input Criteria (search_criteria, sorting, paging)
  * @param null $form_ids array Gravity Forms form IDs
  * @return array|mixed|void
  */
 public static function calculate_get_entries_criteria($passed_criteria = null, $form_ids = null)
 {
     $search_criteria_defaults = array('search_criteria' => null, 'sorting' => null, 'paging' => null, 'cache' => isset($passed_criteria['cache']) ? $passed_criteria['cache'] : true);
     $criteria = wp_parse_args($passed_criteria, $search_criteria_defaults);
     if (!empty($criteria['search_criteria']['field_filters'])) {
         foreach ($criteria['search_criteria']['field_filters'] as &$filter) {
             if (!is_array($filter)) {
                 continue;
             }
             // By default, we want searches to be wildcard for each field.
             $filter['operator'] = empty($filter['operator']) ? 'contains' : $filter['operator'];
             /**
              * @filter `gravityview_search_operator` Modify the search operator for the field (contains, is, isnot, etc)
              * @param string $operator Existing search operator
              * @param array $filter array with `key`, `value`, `operator`, `type` keys
              */
             $filter['operator'] = apply_filters('gravityview_search_operator', $filter['operator'], $filter);
         }
     }
     /**
      * Prepare date formats to be in Gravity Forms DB format;
      * $passed_criteria may include date formats incompatible with Gravity Forms.
      */
     foreach (array('start_date', 'end_date') as $key) {
         if (!empty($criteria['search_criteria'][$key])) {
             // Use date_create instead of new DateTime so it returns false if invalid date format.
             $date = date_create($criteria['search_criteria'][$key]);
             if ($date) {
                 // Gravity Forms wants dates in the `Y-m-d H:i:s` format.
                 $criteria['search_criteria'][$key] = $date->format('Y-m-d H:i:s');
             } else {
                 // If it's an invalid date, unset it. Gravity Forms freaks out otherwise.
                 unset($criteria['search_criteria'][$key]);
                 do_action('gravityview_log_error', '[filter_get_entries_criteria] ' . $key . ' Date format not valid:', $criteria['search_criteria'][$key]);
             }
         }
     }
     // When multiple views are embedded, OR single entry, calculate the context view id and send it to the advanced filter
     if (class_exists('GravityView_View_Data') && GravityView_View_Data::getInstance()->has_multiple_views() || GravityView_frontend::getInstance()->single_entry) {
         $criteria['context_view_id'] = GravityView_frontend::getInstance()->get_context_view_id();
     } elseif ('delete' === RGForms::get('action')) {
         $criteria['context_view_id'] = isset($_GET['view_id']) ? $_GET['view_id'] : null;
     } elseif (!isset($criteria['context_view_id'])) {
         // Prevent overriding the Context View ID: Some widgets could set the context_view_id (e.g. Recent Entries widget)
         $criteria['context_view_id'] = null;
     }
     /**
      * @filter `gravityview_search_criteria` Apply final criteria filter (Used by the Advanced Filter extension)
      * @param array $criteria Search criteria used by GravityView
      * @param array $form_ids Forms to search
      * @param int $view_id ID of the view being used to search
      */
     $criteria = apply_filters('gravityview_search_criteria', $criteria, $form_ids, $criteria['context_view_id']);
     return $criteria;
 }
开发者ID:roarmoser,项目名称:gv1,代码行数:64,代码来源:class-common.php

示例11: is_campaignmonitor_page

 private static function is_campaignmonitor_page()
 {
     $current_page = trim(strtolower(RGForms::get("page")));
     $campaignmonitor_pages = array("gf_campaignmonitor");
     return in_array($current_page, $campaignmonitor_pages);
 }
开发者ID:hypenotic,项目名称:slowfood,代码行数:6,代码来源:campaignmonitor.php

示例12: get_current_page_url

 public static function get_current_page_url($force_ssl = false)
 {
     $pageURL = 'http';
     if (RGForms::get("HTTPS", $_SERVER) == "on" || $force_ssl) {
         $pageURL .= "s";
     }
     $pageURL .= "://";
     $pageURL .= RGForms::get("HTTP_HOST", $_SERVER) . rgget("REQUEST_URI", $_SERVER);
     return $pageURL;
 }
开发者ID:pwillems,项目名称:mimosa-contents,代码行数:10,代码来源:forms_model.php

示例13: get_field_input

 public static function get_field_input($field, $value = "", $lead_id = 0, $form_id = 0)
 {
     $id = $field["id"];
     $field_id = IS_ADMIN || $form_id == 0 ? "input_{$id}" : "input_" . $form_id . "_{$id}";
     $form_id = IS_ADMIN && empty($form_id) ? $_GET["id"] : $form_id;
     $size = $field["size"];
     $disabled_text = IS_ADMIN && RG_CURRENT_VIEW != "entry" ? "disabled='disabled'" : "";
     $class_suffix = RG_CURRENT_VIEW == "entry" ? "_admin" : "";
     $class = $size . $class_suffix;
     $currency = "";
     if (RG_CURRENT_VIEW == "entry") {
         $lead = RGFormsModel::get_lead($lead_id);
         $post_id = $lead["post_id"];
         $post_link = "";
         if (is_numeric($post_id) && self::is_post_field($field)) {
             $post_link = "You can <a href='post.php?action=edit&post={$post_id}'>edit this post</a> from the post page.";
         }
         $currency = $lead["currency"];
     }
     $field_input = apply_filters("gform_field_input", "", $field, $value, $lead_id, $form_id);
     if ($field_input) {
         return $field_input;
     }
     //product fields are not editable
     if (RG_CURRENT_VIEW == "entry" && self::is_product_field($field["type"])) {
         return "<div class='ginput_container'>" . _e("Product fields are not editable", "gravityforms") . "</div>";
     } else {
         if (RG_CURRENT_VIEW == "entry" && $field["type"] == "donation") {
             return "<div class='ginput_container'>" . _e("Donations are not editable", "gravityforms") . "</div>";
         }
     }
     $max_length = "";
     $html5_attributes = "";
     switch (RGFormsModel::get_input_type($field)) {
         case "total":
             if (RG_CURRENT_VIEW == "entry") {
                 return "<div class='ginput_container'><input type='text' name='input_{$id}' value='{$value}' /></div>";
             } else {
                 return "<div class='ginput_container'><span class='ginput_total ginput_total_{$form_id}'>" . self::to_money("0") . "</span><input type='hidden' name='input_{$id}' id='{$field_id}' class='gform_hidden'/></div>";
             }
             break;
         case "singleproduct":
             $product_name = !is_array($value) || empty($value[$field["id"] . ".1"]) ? esc_attr($field["label"]) : esc_attr($value[$field["id"] . ".1"]);
             $price = !is_array($value) || empty($value[$field["id"] . ".2"]) ? $field["basePrice"] : esc_attr($value[$field["id"] . ".2"]);
             $quantity = is_array($value) ? esc_attr($value[$field["id"] . ".3"]) : "";
             if (empty($price)) {
                 $price = 0;
             }
             $form = RGFormsModel::get_form_meta($form_id);
             $has_quantity = sizeof(GFCommon::get_product_fields_by_type($form, array("quantity"), $field["id"])) > 0;
             if ($has_quantity) {
                 $field["disableQuantity"] = true;
             }
             $quantity_field = "";
             if (IS_ADMIN) {
                 $style = $field["disableQuantity"] ? "style='display:none;'" : "";
                 $quantity_field = " <span class='ginput_quantity_label' {$style}>" . __("Quantity:", "gravityformspaypal") . "</span> <input type='text' name='input_{$id}.3' value='{$quantity}' id='ginput_quantity_{$form_id}_{$field["id"]}' class='ginput_quantity' size='10' />";
             } else {
                 if (!$field["disableQuantity"]) {
                     $tabindex = self::get_tabindex();
                     $quantity_field .= " <span class='ginput_quantity_label'>" . __("Quantity:", "gravityformspaypal") . "</span> <input type='text' name='input_{$id}.3' value='{$quantity}' id='ginput_quantity_{$form_id}_{$field["id"]}' class='ginput_quantity' size='10' {$tabindex}/>";
                 } else {
                     if (!is_numeric($quantity)) {
                         $quantity = 1;
                     }
                     if (!$has_quantity) {
                         $quantity_field .= "<input type='hidden' name='input_{$id}.3' value='{$quantity}' class='ginput_quantity_{$form_id}_{$field["id"]} gform_hidden' />";
                     }
                 }
             }
             return "<div class='ginput_container'><input type='hidden' name='input_{$id}.1' value='{$product_name}' class='gform_hidden' /><span class='ginput_product_price_label'>" . __("Price:", "gravityformspaypal") . "</span> <span class='ginput_product_price' id='{$field_id}'>" . GFCommon::to_money($price, $currency) . "</span><input type='hidden' name='input_{$id}.2' id='ginput_base_price_{$form_id}_{$field["id"]}' class='gform_hidden' value='{$price}'/>{$quantity_field}</div>";
             break;
         case "singleshipping":
             $price = !empty($value) ? $value : $field["basePrice"];
             if (empty($price)) {
                 $price = 0;
             }
             return "<div class='ginput_container'><input type='hidden' name='input_{$id}' value='{$price}' class='gform_hidden'/><span class='ginput_shipping_price' id='{$field_id}'>" . GFCommon::to_money($price, $currency) . "</span></div>";
             break;
         case "website":
             $is_html5 = RGFormsModel::is_html5_enabled();
             $value = empty($value) && !$is_html5 ? "http://" : $value;
             $html_input_type = $is_html5 ? "url" : "text";
             $html5_attributes = $is_html5 ? "placeholder='http://'" : "";
         case "text":
             if (empty($html_input_type)) {
                 $html_input_type = "text";
             }
             if ($field["enablePasswordInput"] && RG_CURRENT_VIEW != "entry") {
                 $html_input_type = "password";
             }
             if (is_numeric($field["maxLength"])) {
                 $max_length = "maxlength='{$field["maxLength"]}'";
             }
             if (!empty($post_link)) {
                 return $post_link;
             }
             $tabindex = self::get_tabindex();
             return sprintf("<div class='ginput_container'><input name='input_%d' id='%s' type='%s' value='%s' class='%s' {$max_length} {$tabindex} {$html5_attributes} %s/></div>", $id, $field_id, $html_input_type, esc_attr($value), esc_attr($class), $disabled_text);
             break;
//.........这里部分代码省略.........
开发者ID:novuscory,项目名称:ACH,代码行数:101,代码来源:common.php

示例14: is_paypal_page

 private static function is_paypal_page()
 {
     $current_page = trim(strtolower(RGForms::get("page")));
     return in_array($current_page, array("gf_paypal"));
 }
开发者ID:bryanmonzon,项目名称:jenjonesdirect,代码行数:5,代码来源:paypal.php

示例15: get_field_input

 public function get_field_input($form, $value = '', $entry = null)
 {
     $is_entry_detail = $this->is_entry_detail();
     $is_form_editor = $this->is_form_editor();
     $is_admin = $is_entry_detail || $is_form_editor;
     $form_id = $form['id'];
     $id = intval($this->id);
     $field_id = $is_entry_detail || $is_form_editor || $form_id == 0 ? "input_{$id}" : 'input_' . $form_id . "_{$id}";
     $form_id = ($is_entry_detail || $is_form_editor) && empty($form_id) ? rgget('id') : $form_id;
     $size = $this->size;
     $class_suffix = RG_CURRENT_VIEW == 'entry' ? '_admin' : '';
     $class = $size . $class_suffix;
     $disabled_text = $is_form_editor ? "disabled='disabled'" : '';
     $class_suffix = $is_entry_detail ? '_admin' : '';
     $form_sub_label_placement = rgar($form, 'subLabelPlacement');
     $field_sub_label_placement = $this->subLabelPlacement;
     $is_sub_label_above = $field_sub_label_placement == 'above' || empty($field_sub_label_placement) && $form_sub_label_placement == 'above';
     $sub_label_class_attribute = $field_sub_label_placement == 'hidden_label' ? "class='hidden_sub_label'" : '';
     $prefix = '';
     $first = '';
     $middle = '';
     $last = '';
     $suffix = '';
     if (is_array($value)) {
         $prefix = esc_attr(RGForms::get($this->id . '.2', $value));
         $first = esc_attr(RGForms::get($this->id . '.3', $value));
         $middle = esc_attr(RGForms::get($this->id . '.4', $value));
         $last = esc_attr(RGForms::get($this->id . '.6', $value));
         $suffix = esc_attr(RGForms::get($this->id . '.8', $value));
     }
     $prefix_input = GFFormsModel::get_input($this, $this->id . '.2');
     $first_input = GFFormsModel::get_input($this, $this->id . '.3');
     $middle_input = GFFormsModel::get_input($this, $this->id . '.4');
     $last_input = GFFormsModel::get_input($this, $this->id . '.6');
     $suffix_input = GFFormsModel::get_input($this, $this->id . '.8');
     $first_placeholder_attribute = GFCommon::get_input_placeholder_attribute($first_input);
     $middle_placeholder_attribute = GFCommon::get_input_placeholder_attribute($middle_input);
     $last_placeholder_attribute = GFCommon::get_input_placeholder_attribute($last_input);
     $suffix_placeholder_attribute = GFCommon::get_input_placeholder_attribute($suffix_input);
     switch ($this->nameFormat) {
         case 'advanced':
         case 'extended':
             $prefix_tabindex = GFCommon::get_tabindex();
             $first_tabindex = GFCommon::get_tabindex();
             $middle_tabindex = GFCommon::get_tabindex();
             $last_tabindex = GFCommon::get_tabindex();
             $suffix_tabindex = GFCommon::get_tabindex();
             $prefix_sub_label = rgar($prefix_input, 'customLabel') != '' ? $prefix_input['customLabel'] : apply_filters("gform_name_prefix_{$form_id}", apply_filters('gform_name_prefix', esc_html__('Prefix', 'gravityforms'), $form_id), $form_id);
             $first_name_sub_label = rgar($first_input, 'customLabel') != '' ? $first_input['customLabel'] : apply_filters("gform_name_first_{$form_id}", apply_filters('gform_name_first', esc_html__('First', 'gravityforms'), $form_id), $form_id);
             $middle_name_sub_label = rgar($middle_input, 'customLabel') != '' ? $middle_input['customLabel'] : apply_filters("gform_name_middle_{$form_id}", apply_filters('gform_name_middle', esc_html__('Middle', 'gravityforms'), $form_id), $form_id);
             $last_name_sub_label = rgar($last_input, 'customLabel') != '' ? $last_input['customLabel'] : apply_filters("gform_name_last_{$form_id}", apply_filters('gform_name_last', esc_html__('Last', 'gravityforms'), $form_id), $form_id);
             $suffix_sub_label = rgar($suffix_input, 'customLabel') != '' ? $suffix_input['customLabel'] : apply_filters("gform_name_suffix_{$form_id}", apply_filters('gform_name_suffix', esc_html__('Suffix', 'gravityforms'), $form_id), $form_id);
             $prefix_markup = '';
             $first_markup = '';
             $middle_markup = '';
             $last_markup = '';
             $suffix_markup = '';
             if ($is_sub_label_above) {
                 $style = $is_admin && rgar($prefix_input, 'isHidden') ? "style='display:none;'" : '';
                 if ($is_admin || !rgar($prefix_input, 'isHidden')) {
                     $prefix_select_class = isset($prefix_input['choices']) && is_array($prefix_input['choices']) ? 'name_prefix_select' : '';
                     $prefix_markup = self::get_name_prefix_field($prefix_input, $id, $field_id, $prefix, $disabled_text, $prefix_tabindex);
                     $prefix_markup = "<span id='{$field_id}_2_container' class='name_prefix {$prefix_select_class}' {$style}>\n                                                    <label for='{$field_id}_2' {$sub_label_class_attribute}>{$prefix_sub_label}</label>\n                                                    {$prefix_markup}\n                                                  </span>";
                 }
                 $style = $is_admin && rgar($first_input, 'isHidden') ? "style='display:none;'" : '';
                 if ($is_admin || !rgar($first_input, 'isHidden')) {
                     $first_markup = "<span id='{$field_id}_3_container' class='name_first' {$style}>\n                                                    <label for='{$field_id}_3' {$sub_label_class_attribute}>{$first_name_sub_label}</label>\n                                                    <input type='text' name='input_{$id}.3' id='{$field_id}_3' value='{$first}' {$first_tabindex} {$disabled_text} {$first_placeholder_attribute}/>\n                                                </span>";
                 }
                 $style = $is_admin && (!isset($middle_input['isHidden']) || rgar($middle_input, 'isHidden')) ? "style='display:none;'" : '';
                 if ($is_admin || isset($middle_input['isHidden']) && $middle_input['isHidden'] == false) {
                     $middle_markup = "<span id='{$field_id}_4_container' class='name_middle' {$style}>\n                                                    <label for='{$field_id}_4' {$sub_label_class_attribute}>{$middle_name_sub_label}</label>\n                                                    <input type='text' name='input_{$id}.4' id='{$field_id}_4' value='{$middle}' {$middle_tabindex} {$disabled_text} {$middle_placeholder_attribute}/>\n                                                </span>";
                 }
                 $style = $is_admin && rgar($last_input, 'isHidden') ? "style='display:none;'" : '';
                 if ($is_admin || !rgar($last_input, 'isHidden')) {
                     $last_markup = "<span id='{$field_id}_6_container' class='name_last' {$style}>\n                                                            <label for='{$field_id}_6' {$sub_label_class_attribute}>{$last_name_sub_label}</label>\n                                                            <input type='text' name='input_{$id}.6' id='{$field_id}_6' value='{$last}' {$last_tabindex} {$disabled_text} {$last_placeholder_attribute}/>\n                                                        </span>";
                 }
                 $style = $is_admin && rgar($suffix_input, 'isHidden') ? "style='display:none;'" : '';
                 if ($is_admin || !rgar($suffix_input, 'isHidden')) {
                     $suffix_select_class = isset($suffix_input['choices']) && is_array($suffix_input['choices']) ? 'name_suffix_select' : '';
                     $suffix_markup = "<span id='{$field_id}_8_container' class='name_suffix {$suffix_select_class}' {$style}>\n                                                        <label for='{$field_id}_8' {$sub_label_class_attribute}>{$suffix_sub_label}</label>\n                                                        <input type='text' name='input_{$id}.8' id='{$field_id}_8' value='{$suffix}' {$suffix_tabindex} {$disabled_text} {$suffix_placeholder_attribute}/>\n                                                    </span>";
                 }
             } else {
                 $style = $is_admin && rgar($prefix_input, 'isHidden') ? "style='display:none;'" : '';
                 if ($is_admin || !rgar($prefix_input, 'isHidden')) {
                     $prefix_select_class = isset($prefix_input['choices']) && is_array($prefix_input['choices']) ? 'name_prefix_select' : '';
                     $prefix_markup = self::get_name_prefix_field($prefix_input, $id, $field_id, $prefix, $disabled_text, $prefix_tabindex);
                     $prefix_markup = "<span id='{$field_id}_2_container' class='name_prefix {$prefix_select_class}' {$style}>\n                                                    {$prefix_markup}\n                                                    <label for='{$field_id}_2' {$sub_label_class_attribute}>{$prefix_sub_label}</label>\n                                                  </span>";
                 }
                 $style = $is_admin && rgar($first_input, 'isHidden') ? "style='display:none;'" : '';
                 if ($is_admin || !rgar($first_input, 'isHidden')) {
                     $first_markup = "<span id='{$field_id}_3_container' class='name_first' {$style}>\n                                                    <input type='text' name='input_{$id}.3' id='{$field_id}_3' value='{$first}' {$first_tabindex} {$disabled_text} {$first_placeholder_attribute}/>\n                                                    <label for='{$field_id}_3' {$sub_label_class_attribute}>{$first_name_sub_label}</label>\n                                                </span>";
                 }
                 $style = $is_admin && (!isset($middle_input['isHidden']) || rgar($middle_input, 'isHidden')) ? "style='display:none;'" : '';
                 if ($is_admin || isset($middle_input['isHidden']) && $middle_input['isHidden'] == false) {
                     $middle_markup = "<span id='{$field_id}_4_container' class='name_middle' {$style}>\n                                                    <input type='text' name='input_{$id}.4' id='{$field_id}_4' value='{$middle}' {$middle_tabindex} {$disabled_text} {$middle_placeholder_attribute}/>\n                                                    <label for='{$field_id}_4' {$sub_label_class_attribute}>{$middle_name_sub_label}</label>\n                                                </span>";
                 }
                 $style = $is_admin && rgar($last_input, 'isHidden') ? "style='display:none;'" : '';
                 if ($is_admin || !rgar($last_input, 'isHidden')) {
                     $last_markup = "<span id='{$field_id}_6_container' class='name_last' {$style}>\n                                                    <input type='text' name='input_{$id}.6' id='{$field_id}_6' value='{$last}' {$last_tabindex} {$disabled_text} {$last_placeholder_attribute}/>\n                                                    <label for='{$field_id}_6' {$sub_label_class_attribute}>{$last_name_sub_label}</label>\n                                                </span>";
                 }
//.........这里部分代码省略.........
开发者ID:christopherhodges,项目名称:wp-api,代码行数:101,代码来源:class-gf-field-name.php


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