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


PHP GVCommon::get_meta_form_id方法代碼示例

本文整理匯總了PHP中GVCommon::get_meta_form_id方法的典型用法代碼示例。如果您正苦於以下問題:PHP GVCommon::get_meta_form_id方法的具體用法?PHP GVCommon::get_meta_form_id怎麽用?PHP GVCommon::get_meta_form_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GVCommon的用法示例。


在下文中一共展示了GVCommon::get_meta_form_id方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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_id

/**
 * Get the connected form ID from a View ID
 *
 * @see GVCommon::get_meta_form_id
 *
 * @param int $view_id ID of the View you want the form of
 *
 * @return false|string ID of the connected Form, if exists. Empty string if not. False if not the View ID isn't valid.
 */
function gravityview_get_form_id($view_id)
{
    return GVCommon::get_meta_form_id($view_id);
}
開發者ID:mgratch,項目名稱:GravityView,代碼行數:13,代碼來源:connector-functions.php

示例3: test_get_meta_form_id

 /**
  * @covers GVCommon::get_meta_form_id
  * @covers ::gravityview_get_form_id()
  */
 function test_get_meta_form_id()
 {
     $form_id = '1234';
     $view_id = $this->factory->view->create(array('form_id' => $form_id));
     $this->assertEquals($form_id, GVCommon::get_meta_form_id($view_id));
 }
開發者ID:hansstam,項目名稱:makerfaire,代碼行數:10,代碼來源:GVCommon_Common_Test.php


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