本文整理汇总了PHP中Jetpack::plugin_initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP Jetpack::plugin_initialize方法的具体用法?PHP Jetpack::plugin_initialize怎么用?PHP Jetpack::plugin_initialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jetpack
的用法示例。
在下文中一共展示了Jetpack::plugin_initialize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin_init
function admin_init()
{
// If the plugin is not connected, display a connect message.
if (Jetpack_Options::get_option('do_activate') || !Jetpack_Options::get_option('activated')) {
Jetpack::plugin_initialize();
}
if (!Jetpack::is_active() && !Jetpack::is_development_mode()) {
if (4 != Jetpack_Options::get_option('activated')) {
// Show connect notice on dashboard and plugins pages
add_action('load-index.php', array($this, 'prepare_connect_notice'));
add_action('load-plugins.php', array($this, 'prepare_connect_notice'));
}
} elseif (false === Jetpack_Options::get_option('fallback_no_verify_ssl_certs')) {
// Upgrade: 1.1 -> 1.1.1
// Check and see if host can verify the Jetpack servers' SSL certificate
$args = array();
Jetpack_Client::_wp_remote_request(Jetpack::fix_url_for_bad_hosts(Jetpack::api_url('test')), $args, true);
}
/* Toggle this off as it's not ready for prime time just yet.
if( current_user_can( 'manage_options' ) && self::check_identity_crisis() ) {
add_action( 'admin_notices', array( $this, 'alert_identity_crisis' ) );
}
/**/
if (current_user_can('manage_options') && 'ALWAYS' == JETPACK_CLIENT__HTTPS && !self::permit_ssl()) {
add_action('admin_notices', array($this, 'alert_required_ssl_fail'));
}
add_action('load-plugins.php', array($this, 'intercept_plugin_error_scrape_init'));
add_action('admin_enqueue_scripts', array($this, 'admin_menu_css'));
add_filter('plugin_action_links_' . plugin_basename(JETPACK__PLUGIN_DIR . 'jetpack.php'), array($this, 'plugin_action_links'));
if (Jetpack::is_active() || Jetpack::is_development_mode()) {
// Artificially throw errors in certain whitelisted cases during plugin activation
add_action('activate_plugin', array($this, 'throw_error_on_activate_plugin'));
// Kick off synchronization of user role when it changes
add_action('set_user_role', array($this, 'user_role_change'));
}
}
示例2: admin_init
function admin_init()
{
// If the plugin is not connected, display a connect message.
if (Jetpack_Options::get_option_and_ensure_autoload('do_activate', '0') || !Jetpack_Options::get_option('activated')) {
Jetpack::plugin_initialize();
}
if (!Jetpack::is_active() && !Jetpack::is_development_mode()) {
Jetpack_Connection_Banner::init();
} elseif (false === Jetpack_Options::get_option('fallback_no_verify_ssl_certs')) {
// Upgrade: 1.1 -> 1.1.1
// Check and see if host can verify the Jetpack servers' SSL certificate
$args = array();
Jetpack_Client::_wp_remote_request(Jetpack::fix_url_for_bad_hosts(Jetpack::api_url('test')), $args, true);
} else {
if ($this->can_display_jetpack_manage_notice() && !Jetpack_Options::get_option('dismissed_manage_banner')) {
// Show the notice on the Dashboard only for now
add_action('load-index.php', array($this, 'prepare_manage_jetpack_notice'));
}
}
if (current_user_can('manage_options') && 'AUTO' == JETPACK_CLIENT__HTTPS && !self::permit_ssl()) {
add_action('jetpack_notices', array($this, 'alert_auto_ssl_fail'));
}
add_action('load-plugins.php', array($this, 'intercept_plugin_error_scrape_init'));
add_action('admin_enqueue_scripts', array($this, 'admin_menu_css'));
add_filter('plugin_action_links_' . plugin_basename(JETPACK__PLUGIN_DIR . 'jetpack.php'), array($this, 'plugin_action_links'));
if (Jetpack::is_active() || Jetpack::is_development_mode()) {
// Artificially throw errors in certain whitelisted cases during plugin activation
add_action('activate_plugin', array($this, 'throw_error_on_activate_plugin'));
}
// Jetpack Manage Activation Screen from .com
Jetpack::module_configuration_activation_screen('manage', array($this, 'manage_activate_screen'));
// Add custom column in wp-admin/users.php to show whether user is linked.
add_filter('manage_users_columns', array($this, 'jetpack_icon_user_connected'));
add_action('manage_users_custom_column', array($this, 'jetpack_show_user_connected_icon'), 10, 3);
add_action('admin_print_styles', array($this, 'jetpack_user_col_style'));
}
示例3: admin_init
function admin_init()
{
// If the plugin is not connected, display a connect message.
if (Jetpack::get_option('do_activate') || !Jetpack::get_option('activated')) {
Jetpack::plugin_initialize();
}
if (!($is_active = Jetpack::is_active())) {
add_action('admin_print_styles', array(&$this, 'admin_styles'));
if (4 != Jetpack::get_option('activated')) {
foreach (array('user_admin_notices', 'admin_notices') as $filter) {
add_action($filter, array(&$this, 'admin_connect_notice'));
}
if (Jetpack::state('network_nag')) {
add_action('network_admin_notices', array(&$this, 'network_connect_notice'));
}
}
} elseif (false === Jetpack::get_option('fallback_no_verify_ssl_certs')) {
// Upgrade: 1.1 -> 1.1.1
// Check and see if host can verify the Jetpack servers' SSL certificate
$args = array();
Jetpack_Client::_wp_remote_request(Jetpack::fix_url_for_bad_hosts(Jetpack::api_url('test'), $args), $args, true);
}
add_action('load-plugins.php', array(&$this, 'intercept_plugin_error_scrape_init'));
add_action('admin_head', array(&$this, 'admin_menu_css'));
add_filter('plugin_action_links_' . plugin_basename(__FILE__), array(&$this, 'plugin_action_links'));
add_action('wp_ajax_jetpack_debug', array(&$this, 'ajax_debug'));
if ($is_active) {
// Artificially throw errors in certain whitelisted cases during plugin activation
add_action('activate_plugin', array(&$this, 'throw_error_on_activate_plugin'));
}
}
示例4: admin_init
function admin_init()
{
// If the plugin is not connected, display a connect message.
if (Jetpack::get_option('do_activate') || !Jetpack::get_option('activated')) {
Jetpack::plugin_initialize();
}
if (!Jetpack::is_active() && !Jetpack::is_development_mode()) {
if (4 != Jetpack::get_option('activated')) {
// Show connect notice on dashboard and plugins pages
add_action('load-index.php', array($this, 'prepare_connect_notice'));
add_action('load-plugins.php', array($this, 'prepare_connect_notice'));
}
} elseif (false === Jetpack::get_option('fallback_no_verify_ssl_certs')) {
// Upgrade: 1.1 -> 1.1.1
// Check and see if host can verify the Jetpack servers' SSL certificate
$args = array();
Jetpack_Client::_wp_remote_request(Jetpack::fix_url_for_bad_hosts(Jetpack::api_url('test'), $args), $args, true);
}
add_action('load-plugins.php', array($this, 'intercept_plugin_error_scrape_init'));
add_action('admin_head', array($this, 'admin_menu_css'));
add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'plugin_action_links'));
add_action('wp_ajax_jetpack_debug', array($this, 'ajax_debug'));
if (Jetpack::is_active() || Jetpack::is_development_mode()) {
// Artificially throw errors in certain whitelisted cases during plugin activation
add_action('activate_plugin', array($this, 'throw_error_on_activate_plugin'));
// Kick off synchronization of user role when it changes
add_action('set_user_role', array($this, 'user_role_change'));
// Add retina images hotfix to admin
global $wp_db_version;
if ($wp_db_version > 19470 && $wp_db_version < 22441) {
// WP 3.4.x
// DB Version 22441 = WP 3.5
add_action('admin_enqueue_scripts', array($this, 'enqueue_retina_scripts'));
// /wp-admin/customize.php omits the action above.
add_action('customize_controls_enqueue_scripts', array($this, 'enqueue_retina_scripts'));
}
}
}