当前位置: 首页>>代码示例>>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;未经允许,请勿转载。