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


PHP GVCommon::get_form方法代码示例

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


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

示例1: widget

 public function widget($args, $instance)
 {
     // Don't show unless a View ID has been set.
     if (empty($instance['view_id'])) {
         do_action('gravityview_log_debug', sprintf('%s[widget]: No View ID has been defined. Not showing the widget.', get_class($this)), $instance);
         return;
     }
     /** This filter is documented in wp-includes/default-widgets.php */
     $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
     echo $args['before_widget'];
     if ($title) {
         echo $args['before_title'] . $title . $args['after_title'];
     }
     // @todo Add to the widget configuration form
     $instance['search_layout'] = apply_filters('gravityview/widget/search/layout', 'vertical', $instance);
     $instance['context'] = 'wp_widget';
     // form
     $instance['form_id'] = GVCommon::get_meta_form_id($instance['view_id']);
     $instance['form'] = GVCommon::get_form($instance['form_id']);
     // We don't want to overwrite existing context, etc.
     $previous_view = GravityView_View::getInstance();
     /** @hack */
     new GravityView_View($instance);
     GravityView_Widget_Search::getInstance()->render_frontend($instance);
     /**
      * Restore previous View context
      * @hack
      */
     new GravityView_View($previous_view);
     echo $args['after_widget'];
 }
开发者ID:robinsutherland223,项目名称:gravity,代码行数:31,代码来源:class-gravityview-search-wp-widget.php

示例2: gravityview_get_form

/**
 * Returns the form object for a given Form ID.
 * @see GVCommon::get_form()
 * @access public
 * @param mixed $form_id
 * @return mixed False: no form ID specified or Gravity Forms isn't active. Array: Form returned from Gravity Forms
 */
function gravityview_get_form($form_id)
{
    return GVCommon::get_form($form_id);
}
开发者ID:mgratch,项目名称:GravityView,代码行数:11,代码来源:connector-functions.php

示例3: get_approved_column

 /**
  * Calculate the approve field.input id
  *
  * @access public
  * @static
  * @param mixed $form GF Form or Form ID
  * @return false|null|string Returns the input ID of the approved field. Returns NULL if no approved fields were found. Returns false if $form_id wasn't set.
  */
 public static function get_approved_column($form)
 {
     if (empty($form)) {
         return null;
     }
     if (!is_array($form)) {
         $form = GVCommon::get_form($form);
     }
     foreach ($form['fields'] as $key => $field) {
         $field = (array) $field;
         if (!empty($field['gravityview_approved'])) {
             if (!empty($field['inputs'][0]['id'])) {
                 return $field['inputs'][0]['id'];
             }
         }
         // Note: This is just for backward compatibility from GF Directory plugin and old GV versions - when using i18n it may not work..
         if ('checkbox' == $field['type'] && isset($field['inputs']) && is_array($field['inputs'])) {
             foreach ($field['inputs'] as $key2 => $input) {
                 if (strtolower($input['label']) == 'approved') {
                     return $input['id'];
                 }
             }
         }
     }
     return null;
 }
开发者ID:qqz,项目名称:GravityView,代码行数:34,代码来源:class-admin-approve-entries.php

示例4: _filter_gform_custom_merge_tags

 /**
  * Add custom merge tags to merge tag options. DO NOT OVERRIDE.
  *
  * @internal Not to be overridden by fields
  *
  * @since 1.8.4
  *
  * @param array $custom_merge_tags
  * @param int $form_id GF Form ID
  * @param GF_Field[] $fields Array of fields in the form
  * @param string $element_id The ID of the input that Merge Tags are being used on
  *
  * @return array Modified merge tags
  */
 public function _filter_gform_custom_merge_tags($custom_merge_tags = array(), $form_id, $fields = array(), $element_id = '')
 {
     $form = GVCommon::get_form($form_id);
     $field_merge_tags = $this->custom_merge_tags($form, $fields);
     return array_merge($custom_merge_tags, $field_merge_tags);
 }
开发者ID:mgratch,项目名称:GravityView,代码行数:20,代码来源:class-gravityview-field.php


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