当前位置: 首页>>代码示例>>PHP>>正文


PHP Jetpack::get_active_modules方法代码示例

本文整理汇总了PHP中Jetpack::get_active_modules方法的典型用法代码示例。如果您正苦于以下问题:PHP Jetpack::get_active_modules方法的具体用法?PHP Jetpack::get_active_modules怎么用?PHP Jetpack::get_active_modules使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Jetpack的用法示例。


在下文中一共展示了Jetpack::get_active_modules方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: wpcf7_jetpack_admin_notices

function wpcf7_jetpack_admin_notices()
{
    global $wpdb;
    if (!class_exists('Jetpack') || !Jetpack::is_module('contact-form') || !in_array('contact-form', Jetpack::get_active_modules())) {
        return;
    }
    $q = "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = '_old_cf7_unit_id'";
    if (!$wpdb->get_var($q)) {
        return;
    }
    $desc_link = wpcf7_link(__('http://contactform7.com/jetpack-overrides-contact-forms/', 'contact-form-7'), __('Jetpack Overrides Contact Forms', 'contact-form-7'));
    ?>
<div class="notice notice-warning">
<p><?php 
    echo sprintf(esc_html(__('Jetpack may cause problems for other plugins in certain cases. For more details, see %s.', 'contact-form-7')), $desc_link);
    ?>
</p>
</div>
<?php 
}
开发者ID:flasomm,项目名称:Montkailash,代码行数:20,代码来源:jetpack.php

示例2: __construct

 function __construct()
 {
     global $publicize_ui;
     $this->in_jetpack = class_exists('Jetpack') && method_exists('Jetpack', 'enable_module_configurable') ? true : false;
     if ($this->in_jetpack && method_exists('Jetpack', 'module_configuration_load')) {
         Jetpack::enable_module_configurable(__FILE__);
         Jetpack::module_configuration_load(__FILE__, array($this, 'jetpack_configuration_load'));
         add_action('init', array($this, 'sync_posts_init'), 999);
     }
     require_once dirname(__FILE__) . '/publicize/publicize.php';
     if ($this->in_jetpack) {
         require_once dirname(__FILE__) . '/publicize/publicize-jetpack.php';
     } else {
         require_once dirname(dirname(__FILE__)) . '/mu-plugins/keyring/keyring.php';
         require_once dirname(__FILE__) . '/publicize/publicize-wpcom.php';
     }
     require_once dirname(__FILE__) . '/publicize/ui.php';
     $publicize_ui = new Publicize_UI();
     $publicize_ui->in_jetpack = $this->in_jetpack;
     // Jetpack specific checks / hooks
     if ($this->in_jetpack) {
         add_action('jetpack_activate_module_publicize', array($this, 'module_state_toggle'));
         add_action('jetpack_deactivate_module_publicize', array($this, 'module_state_toggle'));
         add_filter('jetpack_sync_post_module_custom_data', array($this, 'sync_post_module_custom_data'), 10, 2);
         // if sharedaddy isn't active, the sharing menu hasn't been added yet
         $active = Jetpack::get_active_modules();
         if (in_array('publicize', $active) && !in_array('sharedaddy', $active)) {
             add_action('admin_menu', array(&$publicize_ui, 'sharing_menu'));
         }
     }
 }
开发者ID:moushegh,项目名称:blog-source-configs,代码行数:31,代码来源:publicize.php

示例3: enlightenment_general_settings

function enlightenment_general_settings()
{
    add_settings_section('navbar', __('Navbar', 'enlightenment'), '__return_false', 'enlightenment_theme_options');
    add_settings_section('page_header', __('Page Header', 'enlightenment'), '__return_false', 'enlightenment_theme_options');
    add_settings_section('post_thumbnails', __('Post Thumbnails', 'enlightenment'), '__return_false', 'enlightenment_theme_options');
    add_settings_section('entry_meta', __('Entry Meta', 'enlightenment'), '__return_false', 'enlightenment_theme_options');
    add_settings_section('lightbox', __('Lightbox', 'enlightenment'), '__return_false', 'enlightenment_theme_options');
    add_settings_section('posts_nav', __('Posts Navigation', 'enlightenment'), '__return_false', 'enlightenment_theme_options');
    add_settings_section('footer', __('Footer', 'enlightenment'), '__return_false', 'enlightenment_theme_options');
    add_settings_field('navbar_position', __('Navbar Position', 'enlightenment'), 'enlightenment_select_box', 'enlightenment_theme_options', 'navbar', array('name' => 'navbar_position', 'options' => array('fixed-top' => 'Fixed on Top', 'static-top' => 'Static')));
    add_settings_field('navbar_background', __('Navbar Background Color', 'enlightenment'), 'enlightenment_select_box', 'enlightenment_theme_options', 'navbar', array('name' => 'navbar_background', 'options' => array('default' => 'Light', 'inverse' => 'Dark')));
    add_settings_field('navbar_size', __('Navbar Size', 'enlightenment'), 'enlightenment_select_box', 'enlightenment_theme_options', 'navbar', array('name' => 'navbar_size', 'options' => array('small' => 'Small', 'large' => 'Large'), 'description' => __('Menu Item Descriptions are hidden in the small Navbar.', 'enlightenment')));
    add_settings_field('shrink_navbar', __('Shrink Navbar', 'enlightenment'), 'enlightenment_checkbox', 'enlightenment_theme_options', 'navbar', array('name' => 'shrink_navbar', 'label' => __('Shrink Fixed Navbar when scrolling', 'enlightenment')));
    add_settings_field('blog_header_text', __('Blog Pages Header Text', 'enlightenment'), 'enlightenment_text_input', 'enlightenment_theme_options', 'page_header', array('name' => 'blog_header_text'));
    add_settings_field('blog_header_description', __('Blog Pages Description', 'enlightenment'), 'enlightenment_textarea', 'enlightenment_theme_options', 'page_header', array('name' => 'blog_header_description'));
    add_settings_field('thumbnail_header_image', __('Thumbnail Header Image', 'enlightenment'), 'enlightenment_checkbox', 'enlightenment_theme_options', 'page_header', array('name' => 'thumbnail_header_image', 'label' => __('Display post thumbnail as header image on single posts', 'enlightenment')));
    add_settings_field('thumbnails_crop_flag', __('Crop Thumbnails', 'enlightenment'), 'enlightenment_checkbox', 'enlightenment_theme_options', 'post_thumbnails', array('name' => 'thumbnails_crop_flag', 'label' => __('Hard crop post thumbnails', 'enlightenment'), 'description' => sprintf(__('After changing this option, it is recommended to recreate your thumbnails using a plugin like <a href="%s">AJAX Thumbnail Rebuild</a>', 'enlightenment'), esc_url('http://wordpress.org/extend/plugins/ajax-thumbnail-rebuild/'))));
    add_settings_field('thumbnails_size', __('Thumbnails Size', 'enlightenment'), 'enlightenment_select_box', 'enlightenment_theme_options', 'post_thumbnails', array('name' => 'thumbnails_size', 'options' => array('small' => 'Small', 'large' => 'Large')));
    $post_meta = enlightenment_theme_option('post_meta');
    add_settings_field('post_meta', __('Post Meta', 'enlightenment'), 'enlightenment_checkboxes', 'enlightenment_theme_options', 'entry_meta', array('boxes' => array(array('name' => 'post_meta[author]', 'label' => __('Author', 'enlightenment'), 'checked' => $post_meta['author']), array('name' => 'post_meta[date]', 'label' => __('Date', 'enlightenment'), 'checked' => $post_meta['date']), array('name' => 'post_meta[category]', 'label' => __('Category', 'enlightenment'), 'checked' => $post_meta['category']), array('name' => 'post_meta[comments]', 'label' => __('Comments', 'enlightenment'), 'checked' => $post_meta['comments']), array('name' => 'post_meta[edit_link]', 'label' => __('Edit Post Link', 'enlightenment'), 'checked' => $post_meta['edit_link']))));
    if (class_exists('Jetpack') && in_array('custom-content-types', Jetpack::get_active_modules())) {
        $post_meta = enlightenment_theme_option('portfolio_meta');
        add_settings_field('portfolio_meta', __('Portfolio Meta', 'enlightenment'), 'enlightenment_checkboxes', 'enlightenment_theme_options', 'entry_meta', array('boxes' => array(array('name' => 'portfolio_meta[author]', 'label' => __('Author', 'enlightenment'), 'checked' => $post_meta['author']), array('name' => 'portfolio_meta[date]', 'label' => __('Date', 'enlightenment'), 'checked' => $post_meta['date']), array('name' => 'portfolio_meta[project_type]', 'label' => __('Project Type', 'enlightenment'), 'checked' => $post_meta['project_type']), array('name' => 'portfolio_meta[comments]', 'label' => __('Comments', 'enlightenment'), 'checked' => $post_meta['comments']), array('name' => 'portfolio_meta[edit_link]', 'label' => __('Edit Project Link', 'enlightenment'), 'checked' => $post_meta['edit_link']))));
    }
    add_settings_field('enable_lightbox', __('Enable Lightbox', 'enlightenment'), 'enlightenment_checkbox', 'enlightenment_theme_options', 'lightbox', array('name' => 'enable_lightbox', 'label' => __('Open image links in a lightbox', 'enlightenment')));
    add_settings_field('lightbox_script', __('Lightbox Script', 'enlightenment'), 'enlightenment_select_box', 'enlightenment_theme_options', 'lightbox', array('name' => 'lightbox_script', 'options' => array('colorbox' => __('Colorbox', 'enlightenment'), 'fluidbox' => __('Fluidbox', 'enlightenment'), 'imagelightbox' => __('ImageLightbox.js', 'enlightenment'))));
    add_settings_field('posts_nav_style', __('Posts Navigation Style', 'enlightenment'), 'enlightenment_select_box', 'enlightenment_theme_options', 'posts_nav', array('name' => 'posts_nav_style', 'options' => array('static' => __('Static Links', 'enlightenment'), 'ajax' => 'AJAX Links', 'infinite' => 'Infinite Scroll')));
    add_settings_field('posts_nav_labels', __('Static Links Labels', 'enlightenment'), 'enlightenment_select_box', 'enlightenment_theme_options', 'posts_nav', array('name' => 'posts_nav_labels', 'options' => array('next/prev' => __('Next Page / Previous Page', 'enlightenment'), 'older/newer' => __('Older Posts / Newer Posts', 'enlightenment'), 'earlier/later' => __('Earlier Posts / Later Posts', 'enlightenment'), 'numbered' => __('Numbered Pagination', 'enlightenment'))));
    add_settings_field('copyright_notice', __('Copyright Notice', 'enlightenment'), 'enlightenment_text_input', 'enlightenment_theme_options', 'footer', array('name' => 'copyright_notice', 'description' => __('%year% = Current Year, %sitename% = Website Name', 'enlightenment')));
    add_settings_field('credit_links', __('Credit Links', 'enlightenment'), 'enlightenment_checkboxes', 'enlightenment_theme_options', 'footer', array('boxes' => array(array('name' => 'theme_credit_link', 'label' => 'Theme Credit Link'), array('name' => 'author_credit_link', 'label' => 'Theme Author Credit Link'), array('name' => 'wordpress_credit_link', 'label' => 'WordPress Credit Link'))));
}
开发者ID:thano,项目名称:cfpi-theme-2016,代码行数:31,代码来源:theme-options.php

示例4: test_sync_callable_whitelist

 public function test_sync_callable_whitelist()
 {
     // $this->setSyncClientDefaults();
     $callables = array('wp_max_upload_size' => wp_max_upload_size(), 'is_main_network' => Jetpack::is_multi_network(), 'is_multi_site' => is_multisite(), 'main_network_site' => Jetpack_Sync_Functions::main_network_site_url(), 'single_user_site' => Jetpack::is_single_user_site(), 'updates' => Jetpack::get_updates(), 'home_url' => Jetpack_Sync_Functions::home_url(), 'site_url' => Jetpack_Sync_Functions::site_url(), 'has_file_system_write_access' => Jetpack_Sync_Functions::file_system_write_access(), 'is_version_controlled' => Jetpack_Sync_Functions::is_version_controlled(), 'taxonomies' => Jetpack_Sync_Functions::get_taxonomies(), 'post_types' => Jetpack_Sync_Functions::get_post_types(), 'post_type_features' => Jetpack_Sync_Functions::get_post_type_features(), 'rest_api_allowed_post_types' => Jetpack_Sync_Functions::rest_api_allowed_post_types(), 'rest_api_allowed_public_metadata' => Jetpack_Sync_Functions::rest_api_allowed_public_metadata(), 'sso_is_two_step_required' => Jetpack_SSO_Helpers::is_two_step_required(), 'sso_should_hide_login_form' => Jetpack_SSO_Helpers::should_hide_login_form(), 'sso_match_by_email' => Jetpack_SSO_Helpers::match_by_email(), 'sso_new_user_override' => Jetpack_SSO_Helpers::new_user_override(), 'sso_bypass_default_login_form' => Jetpack_SSO_Helpers::bypass_login_forward_wpcom(), 'wp_version' => Jetpack_Sync_Functions::wp_version(), 'get_plugins' => Jetpack_Sync_Functions::get_plugins(), 'active_modules' => Jetpack::get_active_modules(), 'hosting_provider' => Jetpack_Sync_Functions::get_hosting_provider(), 'locale' => get_locale(), 'site_icon_url' => Jetpack_Sync_Functions::site_icon_url());
     if (is_multisite()) {
         $callables['network_name'] = Jetpack::network_name();
         $callables['network_allow_new_registrations'] = Jetpack::network_allow_new_registrations();
         $callables['network_add_new_users'] = Jetpack::network_add_new_users();
         $callables['network_site_upload_space'] = Jetpack::network_site_upload_space();
         $callables['network_upload_file_types'] = Jetpack::network_upload_file_types();
         $callables['network_enable_administration_menus'] = Jetpack::network_enable_administration_menus();
     }
     $this->sender->do_sync();
     foreach ($callables as $name => $value) {
         // TODO: figure out why _sometimes_ the 'support' value of
         // the post_types value is being removed from the output
         if ($name === 'post_types') {
             continue;
         }
         $this->assertCallableIsSynced($name, $value);
     }
     $whitelist_keys = array_keys($this->callable_module->get_callable_whitelist());
     $callables_keys = array_keys($callables);
     // Are we testing all the callables in the defaults?
     $whitelist_and_callable_keys_difference = array_diff($whitelist_keys, $callables_keys);
     $this->assertTrue(empty($whitelist_and_callable_keys_difference), 'Some whitelisted options don\'t have a test: ' . print_r($whitelist_and_callable_keys_difference, 1));
     // Are there any duplicate keys?
     $unique_whitelist = array_unique($whitelist_keys);
     $this->assertEquals(count($unique_whitelist), count($whitelist_keys), 'The duplicate keys are: ' . print_r(array_diff_key($whitelist_keys, array_unique($whitelist_keys)), 1));
 }
开发者ID:automattic,项目名称:jetpack,代码行数:30,代码来源:test_class.jetpack-sync-callables.php

示例5: __construct

 public function __construct()
 {
     $this->in_jetpack = defined('IS_WPCOM') && IS_WPCOM ? false : true;
     if ($this->in_jetpack) {
         $active = Jetpack::get_active_modules();
         if (!in_array('sharedaddy', $active) && !in_array('publicize', $active) && !in_array('likes', $active)) {
             add_action('admin_menu', array($this, 'sharing_menu'));
             // we don't have a sharing page yet
         }
         add_action('jetpack_activate_module_likes', array($this, 'module_toggle'));
         add_action('jetpack_deactivate_module_likes', array($this, 'module_toggle'));
         Jetpack::enable_module_configurable(__FILE__);
         Jetpack::module_configuration_load(__FILE__, array($this, 'configuration_redirect'));
     }
     // The visible UI elements for the user
     add_action('load-settings_page_sharing', array($this, 'load_management_script_assets'));
     add_action('pre_admin_screen_sharing', array($this, 'connection_screen'), 15);
     add_action('admin_init', array($this, 'add_meta_box'));
     add_action('do_meta_boxes', array($this, 'should_we_show_the_meta_box'));
     add_action('sharing_global_options', array($this, 'admin_settings_init'), 20);
     add_action('sharing_admin_update', array($this, 'admin_settings_callback'), 20);
     if ($this->in_jetpack) {
         add_action('pre_admin_screen_sharing', array($this, 'jetpack_disconnect'), 10);
     }
 }
开发者ID:lokenxo,项目名称:familygenerator,代码行数:25,代码来源:ui.php

示例6: subscription_menu

 public function subscription_menu($user)
 {
     if (!defined('IS_WPCOM') || !IS_WPCOM) {
         $active = Jetpack::get_active_modules();
         if (!in_array('publicize', $active) && !current_user_can('manage_options')) {
             return;
         }
     }
     add_submenu_page('options-general.php', __('Sharing Settings', 'jetpack'), __('Sharing', 'jetpack'), 'publish_posts', 'sharing', array(&$this, 'management_page'));
 }
开发者ID:annbransom,项目名称:techishowl_prod_backup,代码行数:10,代码来源:sharing.php

示例7: array

 function get_modules()
 {
     include_once JETPACK__PLUGIN_DIR . 'modules/module-info.php';
     $available_modules = $this->jetpack->get_available_modules();
     $active_modules = $this->jetpack->get_active_modules();
     $modules = array();
     $jetpack_active = Jetpack::is_active() || Jetpack::is_development_mode();
     foreach ($available_modules as $module) {
         if ($module_array = $this->jetpack->get_module($module)) {
             $short_desc = apply_filters('jetpack_short_module_description', $module_array['description'], $module);
             // Fix: correct multibyte strings truncate with checking for mbstring extension
             $short_desc_trunc = function_exists('mb_strlen') ? mb_strlen($short_desc) > 143 ? mb_substr($short_desc, 0, 140) . '...' : $short_desc : (strlen($short_desc) > 143 ? substr($short_desc, 0, 140) . '...' : $short_desc);
             $module_array['module'] = $module;
             $module_array['activated'] = $jetpack_active ? in_array($module, $active_modules) : false;
             $module_array['deactivate_nonce'] = wp_create_nonce('jetpack_deactivate-' . $module);
             $module_array['activate_nonce'] = wp_create_nonce('jetpack_activate-' . $module);
             $module_array['available'] = self::is_module_available($module_array);
             $module_array['short_description'] = $short_desc_trunc;
             $module_array['configure_url'] = Jetpack::module_configuration_url($module);
             ob_start();
             do_action('jetpack_learn_more_button_' . $module);
             $module_array['learn_more_button'] = ob_get_clean();
             ob_start();
             if (Jetpack::is_active() && has_action('jetpack_module_more_info_connected_' . $module)) {
                 do_action('jetpack_module_more_info_connected_' . $module);
             } else {
                 do_action('jetpack_module_more_info_' . $module);
             }
             $module_array['long_description'] = ob_get_clean();
             $module_array['configurable'] = false;
             if (current_user_can('manage_options') && apply_filters('jetpack_module_configurable_' . $module, false)) {
                 $module_array['configurable'] = sprintf('<a href="%1$s">%2$s</a>', esc_url(Jetpack::module_configuration_url($module)), __('Configure', 'jetpack'));
             }
             $modules[$module] = $module_array;
         }
     }
     uasort($modules, array($this->jetpack, 'sort_modules'));
     if (!Jetpack::is_active()) {
         uasort($modules, array(__CLASS__, 'sort_requires_connection_last'));
     }
     return $modules;
 }
开发者ID:dtekcth,项目名称:datateknologer.se,代码行数:42,代码来源:class.jetpack-admin.php

示例8: __construct

	function __construct() {
		$this->in_jetpack = ( defined( 'IS_WPCOM' ) && IS_WPCOM ) ? false : true;

		add_action( 'init', array( &$this, 'action_init' ) );
		add_action( 'admin_init', array( $this, 'admin_init' ) );

		if ( $this->in_jetpack ) {
			add_action( 'jetpack_activate_module_likes',   array( $this, 'module_toggle' ) );
			add_action( 'jetpack_deactivate_module_likes', array( $this, 'module_toggle' ) );

			Jetpack::enable_module_configurable( __FILE__ );
			Jetpack::module_configuration_load( __FILE__, array( $this, 'configuration_redirect' ) );

			add_action('admin_print_scripts-settings_page_sharing', array( &$this, 'load_jp_css' ) );
			add_filter( 'sharing_show_buttons_on_row_start', array( $this, 'configuration_target_area' ) );

			$active = Jetpack::get_active_modules();

			if ( ! in_array( 'sharedaddy', $active ) && ! in_array( 'publicize', $active ) ) {
				add_action( 'admin_menu', array( $this, 'sharing_menu' ) );	// we don't have a sharing page yet
			}

			if ( in_array( 'publicize', $active ) && ! in_array( 'sharedaddy', $active ) ) {
				add_action( 'pre_admin_screen_sharing', array( $this, 'sharing_block' ), 20 ); // we have a sharing page but not the global options area
				add_action( 'pre_admin_screen_sharing', array( $this, 'updated_message' ), -10 );
			}

			if( ! in_array( 'sharedaddy', $active ) ) {
				add_action( 'admin_init', array( $this, 'process_update_requests_if_sharedaddy_not_loaded' ) );
				add_action( 'sharing_global_options', array( $this, 'admin_settings_showbuttonon_init' ), 19 );
				add_action( 'sharing_admin_update', array( $this, 'admin_settings_showbuttonon_callback' ), 19 );
				add_action( 'admin_init', array( $this, 'add_meta_box' ) );
			} else {
				add_filter( 'sharing_meta_box_title', array( $this, 'add_likes_to_sharing_meta_box_title' ) );
				add_action( 'start_sharing_meta_box_content', array( $this, 'meta_box_content' ) );
			}

			Jetpack_Sync::sync_options( __FILE__, 'social_notifications_like' );

		} else { // wpcom
			add_action( 'admin_init', array( $this, 'add_meta_box' ) );
			add_action( 'end_likes_meta_box_content', array( $this, 'sharing_meta_box_content' ) );
			add_filter( 'likes_meta_box_title', array( $this, 'add_likes_to_sharing_meta_box_title' ) );
		}

		add_action( 'admin_init', array( $this, 'admin_discussion_likes_settings_init' ) ); // Likes notifications

		add_action( 'admin_bar_menu', array( $this, 'admin_bar_likes' ), 60 );

		add_action( 'save_post', array( $this, 'meta_box_save' ) );
		add_action( 'sharing_global_options', array( $this, 'admin_settings_init' ), 20 );
		add_action( 'sharing_admin_update',   array( $this, 'admin_settings_callback' ), 20 );
	}
开发者ID:pauEscarcia,项目名称:AIMM,代码行数:53,代码来源:LIKES.PHP

示例9: wpcf7_jetpack_admin_notices

function wpcf7_jetpack_admin_notices()
{
    if (!class_exists('Jetpack') || !Jetpack::is_module('contact-form') || !in_array('contact-form', Jetpack::get_active_modules())) {
        return;
    }
    $url = 'http://contactform7.com/jetpack-overrides-contact-forms/';
    ?>
<div class="error">
<p><?php 
    echo sprintf(__('<strong>Jetpack may cause problems for other plugins in certain cases.</strong> <a href="%s" target="_blank">See how to avoid it.</a>', 'wpcf7'), $url);
    ?>
</p>
</div>
<?php 
}
开发者ID:Savantos,项目名称:cow-theme,代码行数:15,代码来源:jetpack.php

示例10: cron_exec

 /**
  * Method that gets executed on the wp-cron call
  * 
  * @since 2.3.3
  * @global string $wp_version 
  */
 public function cron_exec()
 {
     /*
      * Check for an identity crisis
      * 
      * If one exists:
      * - Bump stat for ID crisis
      * - Email site admin about potential ID crisis
      */
     /**
      * Setup an array of items that will eventually be stringified
      * and sent off to the Jetpack API 
      * 
      * Associative array with format group => values
      * - values should be an array that will be imploded to a string
      */
     $jetpack = $this->jetpack;
     $jetpack->stat('active-modules', implode(',', $this->jetpack->get_active_modules()));
     $jetpack->stat('active', JETPACK__VERSION);
     $jetpack->stat('wp-version', get_bloginfo('version'));
     $jetpack->stat('php-version', PHP_VERSION);
     $jetpack->stat('ssl', $jetpack->permit_ssl());
     $jetpack->stat('language', get_bloginfo('language'));
     $jetpack->stat('charset', get_bloginfo('charset'));
     $jetpack->stat('qty-posts', wp_count_posts()->publish);
     $jetpack->stat('qty-pages', wp_count_posts('page')->publish);
     $jetpack->stat('qty-comments', wp_count_comments()->approved);
     $jetpack->stat('is-multisite', is_multisite() ? 'multisite' : 'singlesite');
     // Only check a few plugins, to see if they're currently active.
     $plugins_to_check = array('vaultpress/vaultpress.php', 'akismet/akismet.php', 'wp-super-cache/wp-cache.php');
     $plugins = array_intersect($plugins_to_check, get_option('active_plugins', array()));
     foreach ($plugins as $plugin) {
         $jetpack->stat('plugins', $plugin);
     }
     $jetpack->do_stats('server_side');
 }
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:42,代码来源:class.jetpack-heartbeat.php

示例11: get_container_extra_data

 protected function get_container_extra_data()
 {
     global $post;
     $blog_id = (int) get_current_blog_id();
     if (defined('IS_WPCOM') && IS_WPCOM) {
         $likes_blog_id = $blog_id;
     } else {
         $likes_blog_id = Jetpack_Options::get_option('id');
     }
     if (class_exists('Jetpack_Carousel') || in_array('carousel', Jetpack::get_active_modules()) || 'carousel' == $this->link) {
         $extra_data = array('blog_id' => $blog_id, 'permalink' => get_permalink(isset($post->ID) ? $post->ID : 0), 'likes_blog_id' => $likes_blog_id);
     } else {
         $extra_data = null;
     }
     return $extra_data;
 }
开发者ID:iamtakashi,项目名称:jetpack,代码行数:16,代码来源:tiled-gallery-layout.php

示例12: wpcf7_jetpack_admin_notices

function wpcf7_jetpack_admin_notices()
{
    global $wpdb;
    if (!class_exists('Jetpack') || !Jetpack::is_module('contact-form') || !in_array('contact-form', Jetpack::get_active_modules())) {
        return;
    }
    $q = "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = '_old_cf7_unit_id'";
    if (!$wpdb->get_var($q)) {
        return;
    }
    $url = 'http://contactform7.com/jetpack-overrides-contact-forms/';
    ?>
<div class="error">
<p><?php 
    echo sprintf(__('<strong>Jetpack may cause problems for other plugins in certain cases.</strong> <a href="%s" target="_blank">See how to avoid it.</a>', 'wpcf7'), $url);
    ?>
</p>
</div>
<?php 
}
开发者ID:KurtMakesWeb,项目名称:CandG,代码行数:20,代码来源:jetpack.php

示例13: get_common_sync_data

 function get_common_sync_data()
 {
     $available_modules = Jetpack::get_available_modules();
     $active_modules = Jetpack::get_active_modules();
     $modules = array();
     foreach ($available_modules as $available_module) {
         $modules[$available_module] = in_array($available_module, $active_modules);
     }
     $modules['vaultpress'] = class_exists('VaultPress') || function_exists('vaultpress_contact_service');
     $sync_data = array('modules' => $modules, 'version' => JETPACK__VERSION);
     return $sync_data;
 }
开发者ID:briancompton,项目名称:knightsplaza,代码行数:12,代码来源:class.jetpack-sync.php

示例14: gallery_shortcode

 public function gallery_shortcode($val, $atts)
 {
     if (!empty($val)) {
         // something else is overriding post_gallery, like a custom VIP shortcode
         return $val;
     }
     global $post;
     $this->set_atts($atts);
     $attachments = $this->get_attachments();
     if (empty($attachments)) {
         return '';
     }
     if (is_feed() || defined('IS_HTML_EMAIL')) {
         return '';
     }
     if (method_exists($this, $this->atts['type'] . '_talavera')) {
         // Enqueue styles and scripts
         $this->default_scripts_and_styles();
         $gallery_html = call_user_func_array(array($this, $this->atts['type'] . '_talavera'), array($attachments));
         if ($gallery_html && class_exists('Jetpack') && class_exists('Jetpack_Photon')) {
             // Tiled Galleries in Jetpack require that Photon be active.
             // If it's not active, run it just on the gallery output.
             if (!in_array('photon', Jetpack::get_active_modules())) {
                 $gallery_html = Jetpack_Photon::filter_the_content($gallery_html);
             }
         }
         return $gallery_html;
     }
     return '';
 }
开发者ID:ugurozer,项目名称:little,代码行数:30,代码来源:tiled-gallery.php

示例15: admin_screen_list_modules

    function admin_screen_list_modules()
    {
        require_once JETPACK__PLUGIN_DIR . 'modules/module-info.php';
        $jetpack_connected = true;
        if (!Jetpack::is_active()) {
            $jetpack_connected = false;
        }
        ?>
		<div class="module-container">
		<?php 
        $avail_raw = Jetpack::get_available_modules();
        $available = array();
        $active = Jetpack::get_active_modules();
        $counter = 0;
        foreach ((array) $avail_raw as $module) {
            if ($plugin = Jetpack::get_module($module)) {
                $plugin['module'] = $module;
                $available[] = $plugin;
            }
        }
        unset($avail_raw);
        usort($available, array('Jetpack', 'sort_modules'));
        $jetpack_version = Jetpack_Options::get_option('version');
        if ($jetpack_version) {
            list($jetpack_version, $jetpack_version_time) = explode(':', $jetpack_version);
        } else {
            $jetpack_version = 0;
            $jetpack_version_time = 0;
        }
        $jetpack_old_version = Jetpack_Options::get_option('old_version');
        if ($jetpack_old_version) {
            list($jetpack_old_version) = explode(':', $jetpack_old_version);
        } else {
            $jetpack_old_version = 0;
        }
        $now = time();
        foreach ((array) $available as $module_data) {
            $module = $module_data['module'];
            $activated = in_array($module, $active);
            if ($activated) {
                $css = 'active';
                $toggle = __('Deactivate', 'jetpack');
                $toggle_url = wp_nonce_url(Jetpack::admin_url(array('page' => 'jetpack', 'action' => 'deactivate', 'module' => $module)), "jetpack_deactivate-{$module}");
            } else {
                $css = 'inactive';
                $toggle = __('Activate', 'jetpack');
                $toggle_url = wp_nonce_url(Jetpack::admin_url(array('page' => 'jetpack', 'action' => 'activate', 'module' => $module)), "jetpack_activate-{$module}");
            }
            if ($counter % 4 == 0) {
                $classes = $css . ' jetpack-newline';
                $counter = 0;
            } else {
                $classes = $css;
            }
            $free_text = esc_html($module_data['free'] ? __('Free', 'jetpack') : __('Purchase', 'jetpack'));
            $free_text = apply_filters('jetpack_module_free_text_' . $module, $free_text);
            $badge_text = $free_text;
            if (!$jetpack_connected && !Jetpack::is_development_mode()) {
                $classes = 'x disabled';
            } elseif ($jetpack_version_time + 604800 > $now) {
                // 1 week
                if (version_compare($module_data['introduced'], $jetpack_old_version, '>')) {
                    $badge_text = esc_html__('New', 'jetpack');
                    $classes .= ' jetpack-new-module';
                } elseif (isset($module_data['changed']) && version_compare($module_data['changed'], $jetpack_old_version, '>')) {
                    $badge_text = esc_html__('Updated', 'jetpack');
                    $classes .= ' jetpack-updated-module';
                } else {
                    $badge_text = $free_text;
                }
            }
            ?>
			<div class="jetpack-module jetpack-<?php 
            echo $classes;
            ?>
" id="<?php 
            echo $module;
            ?>
">
				<h3><?php 
            echo esc_html($module_data['name']);
            ?>
</h3>
				<div class="jetpack-module-description">
						<div class="module-image">
							<p><span class="module-image-badge"><?php 
            echo $badge_text;
            ?>
</span><span class="module-image-free" style="display: none"><?php 
            echo $free_text;
            ?>
</span></p>
						</div>

						<p><?php 
            echo apply_filters('jetpack_short_module_description', $module_data['description'], $module);
            ?>
</p>
				</div>

//.........这里部分代码省略.........
开发者ID:lokenxo,项目名称:familygenerator,代码行数:101,代码来源:class.jetpack.php


注:本文中的Jetpack::get_active_modules方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。