本文整理汇总了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();
}
});
}
示例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();
示例3: plugin_version
/**
* Plugin Version
*
* @return string
*/
public static function plugin_version()
{
return Plugin::get_instance()->version;
}
示例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);
}
示例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()));
}
示例6: setUp
public function setUp()
{
$this->plugin = Plugin::get_instance();
$this->schedule_intervals = cron_schedules();
}
示例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();
}
示例8: init
/**
* Constructor
*
* @return void
*/
protected function init()
{
// vars
$this->plugin = Plugin::get_instance();
}