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


PHP Plugin::get_instance方法代碼示例

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


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

示例1: init

 public function init()
 {
     $this->register_api_fields();
     add_action('edit_form_after_editor', array($this, 'output'));
     add_action('save_post', array($this, 'save_post'));
     add_action('admin_enqueue_scripts', function () {
         if ($this->is_allowed_for_screen()) {
             Plugin::get_instance()->enqueue_builder();
         }
     });
 }
開發者ID:Olaw2jr,項目名稱:modular-page-builder,代碼行數:11,代碼來源:class-builder-post-meta.php

示例2: foreach

                $info[$requirement->name()] = $requirement->result();
            }
        }
        foreach (Services::get_services() as $file => $service) {
            array_merge($info, call_user_func(array($service, 'intercom_data')));
        }
        $current_user = wp_get_current_user();
        $info['user_hash'] = hash_hmac('sha256', $current_user->user_email, 'fcUEt7Vi4ym5PXdcr2UNpGdgZTEvxX9NJl8YBTxK');
        $info['email'] = $current_user->user_email;
        $info['created_at'] = strtotime($current_user->user_registered);
        $info['app_id'] = '7f1l4qyq';
        $info['name'] = $current_user->display_name;
        $info['widget'] = array('activator' => '#intercom');
        ?>

		<script id="IntercomSettingsScriptTag">
			window.intercomSettings = <?php 
        echo json_encode($info);
        ?>
;
		</script>
		<script>!function(){function e(){var a=c.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://static.intercomcdn.com/intercom.v1.js";var b=c.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}var a=window,b=a.Intercom;if("function"==typeof b)b("reattach_activator"),b("update",intercomSettings);else{var c=document,d=function(){d.c(arguments)};d.q=[],d.c=function(a){d.q.push(a)},a.Intercom=d,a.attachEvent?a.attachEvent("onload",e):a.addEventListener("load",e,!1)}}();</script>

	<?php 
    }
}
if (is_multisite() && !is_main_site()) {
    return;
}
Plugin::get_instance();
開發者ID:alexanderpetrob89,項目名稱:fei.edu,代碼行數:30,代碼來源:class-plugin.php

示例3: plugin_version

 /**
  * Plugin Version
  *
  * @return string
  */
 public static function plugin_version()
 {
     return Plugin::get_instance()->version;
 }
開發者ID:N-Molham,項目名稱:wp-plugins-boilerplate,代碼行數:9,代碼來源:helpers.php

示例4: test_it_has_a_singleton_instance

 function test_it_has_a_singleton_instance()
 {
     $instance1 = Plugin::get_instance();
     $instance2 = Plugin::get_instance();
     $this->assertSame($instance1, $instance2);
 }
開發者ID:10up,項目名稱:wp-gears,代碼行數:6,代碼來源:PluginTest.php

示例5: __construct

 public function __construct($id, $args)
 {
     $this->id = $id;
     $this->plugin = Plugin::get_instance();
     $this->args = wp_parse_args($args, array('title' => null, 'api_prop' => $this->id, 'allowed_modules' => array()));
 }
開發者ID:Olaw2jr,項目名稱:modular-page-builder,代碼行數:6,代碼來源:class-builder.php

示例6: setUp

 public function setUp()
 {
     $this->plugin = Plugin::get_instance();
     $this->schedule_intervals = cron_schedules();
 }
開發者ID:juaniyyo,項目名稱:backupwordpress,代碼行數:5,代碼來源:testDetermineStartTime.php

示例7: init

/**
 * Initialize and load plugin
 */
function init()
{
    require_once DPS_ENTITLEMENTS_DIR . 'classes/Singleton.php';
    require_once DPS_ENTITLEMENTS_DIR . 'classes/Plugin.php';
    Plugin::get_instance();
}
開發者ID:sc0ttkclark,項目名稱:dps-entitlement-integration,代碼行數:9,代碼來源:dps-entitlement-integration.php

示例8: init

 /**
  * Constructor
  *
  * @return void
  */
 protected function init()
 {
     // vars
     $this->plugin = Plugin::get_instance();
 }
開發者ID:N-Molham,項目名稱:wp-plugins-boilerplate,代碼行數:10,代碼來源:Component.php


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