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


PHP MS_Plugin::set_api方法代碼示例

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


在下文中一共展示了MS_Plugin::set_api方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Construct Settings manager.
  *
  * @since  1.0.0
  * @internal
  */
 public function __construct()
 {
     parent::__construct();
     $this->settings = MS_Plugin::instance()->settings;
     /**
      * Simple check to allow other plugins to quickly find out if
      * Membership2 is loaded and the API was initialized.
      *
      * Example:
      *   if ( apply_filters( 'ms_active', false ) ) { ... }
      */
     add_filter('ms_active', '__return_true');
     /**
      * Make the API controller accessible via MS_Plugin::$api
      */
     MS_Plugin::set_api($this);
     /**
      * Notify other plugins that Membership2 is ready.
      */
     do_action('ms_init', $this);
 }
開發者ID:jsandlin85,項目名稱:SkylineSports,代碼行數:27,代碼來源:class-ms-controller-api.php

示例2: __construct

 /**
  * Private constructor: Singleton pattern.
  *
  * @since  1.0.0
  * @internal
  */
 protected function __construct()
 {
     $this->settings = MS_Plugin::instance()->settings;
     /**
      * Simple check to allow other plugins to quickly find out if
      * Membership2 is loaded and the API was initialized.
      *
      * Example:
      *   if ( apply_filters( 'ms_active', false ) ) { ... }
      *
      * @since  1.0.0
      */
     add_filter('ms_active', '__return_true');
     /**
      * Make the API controller accessible via static property.
      *
      * Example:
      *   $api = MS_Plugin::$api;
      *
      * Alternative:
      *   $api = apply_filters( 'ms_api', false );
      *
      * @since  1.0.0
      */
     MS_Plugin::set_api($this);
     /**
      * Notify other plugins that Membership2 is ready.
      *
      * @since  1.0.0
      */
     do_action('ms_init', $this);
 }
開發者ID:EdoMagen,項目名稱:project-s-v2,代碼行數:38,代碼來源:class-ms-controller-api.php


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