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


PHP Jetpack::get_available_modules方法代码示例

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


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

示例1: 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

示例2: features_available

 /**
  * Returns what features are available. Uses the slug of the module files.
  *
  * @return array|IXR_Error
  */
 function features_available()
 {
     $raw_modules = Jetpack::get_available_modules();
     $modules = array();
     foreach ($raw_modules as $module) {
         $modules[] = Jetpack::get_module_slug($module);
     }
     return $modules;
 }
开发者ID:estrategasdigitales,项目名称:flazam,代码行数:14,代码来源:class.jetpack-xmlrpc-server.php

示例3: generate_stats_array

 public static function generate_stats_array($prefix = '')
 {
     $return = array();
     $return["{$prefix}version"] = JETPACK__VERSION;
     $return["{$prefix}wp-version"] = get_bloginfo('version');
     $return["{$prefix}php-version"] = PHP_VERSION;
     $return["{$prefix}branch"] = floatval(JETPACK__VERSION);
     $return["{$prefix}wp-branch"] = floatval(get_bloginfo('version'));
     $return["{$prefix}php-branch"] = floatval(PHP_VERSION);
     $return["{$prefix}ssl"] = Jetpack::permit_ssl();
     $return["{$prefix}language"] = get_bloginfo('language');
     $return["{$prefix}charset"] = get_bloginfo('charset');
     $return["{$prefix}is-multisite"] = is_multisite() ? 'multisite' : 'singlesite';
     $return["{$prefix}identitycrisis"] = Jetpack::check_identity_crisis(1) ? 'yes' : 'no';
     $return["{$prefix}plugins"] = implode(',', Jetpack::get_active_plugins());
     if (!empty($_SERVER['SERVER_ADDR']) || !empty($_SERVER['LOCAL_ADDR'])) {
         $ip = !empty($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR'];
         $ip_arr = array_map('intval', explode('.', $ip));
         if (4 == sizeof($ip_arr)) {
             $return["{$prefix}ip-2-octets"] = implode('.', array_slice($ip_arr, 0, 2));
             $return["{$prefix}ip-3-octets"] = implode('.', array_slice($ip_arr, 0, 3));
         }
     }
     foreach (Jetpack::get_available_modules() as $slug) {
         $return["{$prefix}module-{$slug}"] = Jetpack::is_module_active($slug) ? 'on' : 'off';
     }
     return $return;
 }
开发者ID:aim-web-projects,项目名称:kobe-chuoh,代码行数:28,代码来源:class.jetpack-heartbeat.php

示例4: render_network_admin_settings_page

 public function render_network_admin_settings_page()
 {
     $this->network_admin_page_header();
     $options = wp_parse_args(get_site_option($this->settings_name), $this->setting_defaults);
     $modules = array();
     $module_slugs = Jetpack::get_available_modules();
     foreach ($module_slugs as $slug) {
         $module = Jetpack::get_module($slug);
         $module['module'] = $slug;
         $modules[] = $module;
     }
     usort($modules, array('Jetpack', 'sort_modules'));
     if (!isset($options['modules'])) {
         $options['modules'] = $modules;
     }
     $data = array('modules' => $modules, 'options' => $options, 'jetpack_protect_whitelist' => jetpack_protect_format_whitelist());
     Jetpack::init()->load_view('admin/network-settings.php', $data);
     $this->network_admin_page_footer();
 }
开发者ID:tinggao,项目名称:woofWarrior,代码行数:19,代码来源:class.jetpack-network.php

示例5: validate_module_list

 /**
  * Validates that the parameter belongs to a list of admitted values.
  *
  * @since 4.3.0
  *
  * @param string $value Value to check.
  * @param WP_REST_Request $request
  * @param string $param Name of the parameter passed to endpoint holding $value.
  *
  * @return bool
  */
 public static function validate_module_list($value = '', $request, $param)
 {
     if (!is_array($value)) {
         return new WP_Error('invalid_param_value', sprintf(esc_html__('%s must be an array', 'jetpack'), $param));
     }
     $modules = Jetpack::get_available_modules();
     if (count(array_intersect($value, $modules)) != count($value)) {
         return new WP_Error('invalid_param_value', sprintf(esc_html__('%s must be a list of valid modules', 'jetpack'), $param));
     }
     return true;
 }
开发者ID:iamtakashi,项目名称:jetpack,代码行数:22,代码来源:class.core-rest-api-endpoints.php

示例6: admin_screen_list_modules

    function admin_screen_list_modules()
    {
        require_once dirname(__FILE__) . '/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'));
        foreach ((array) $available as $module_data) {
            $module = $module_data['module'];
            if (in_array($module, $active)) {
                $css = 'active';
                $toggle = __('Deactivate', 'jetpack');
                $toggle_url = wp_nonce_url(Jetpack::admin_url(array('action' => 'deactivate', 'module' => $module)), "jetpack_deactivate-{$module}");
            } else {
                $css = 'inactive';
                $toggle = __('Activate', 'jetpack');
                $toggle_url = wp_nonce_url(Jetpack::admin_url(array('action' => 'activate', 'module' => $module)), "jetpack_activate-{$module}");
            }
            $file = Jetpack::get_module_path($module);
            $png = str_replace('.php', '.png', $file);
            if (is_readable(dirname(__FILE__) . '/_inc/images/icons/' . basename($png))) {
                $module_img = plugins_url(basename(dirname(__FILE__)) . '/_inc/images/icons/' . basename($png));
            } else {
                $module_img = plugins_url(basename(dirname(__FILE__)) . '/_inc/images/module-blank.png');
            }
            if ($counter % 4 == 0) {
                $classes = $css . ' jetpack-newline';
                $counter = 0;
            } else {
                $classes = $css;
            }
            if (!$jetpack_connected) {
                $classes = 'x disabled';
            }
            ?>
			<div class="jetpack-module jetpack-<?php 
            echo $classes;
            ?>
" id="<?php 
            echo $module;
            ?>
">
				<h3><?php 
            echo $module_data['name'];
            ?>
</h3>
				<div class="jetpack-module-description">
						<div class="module-image">
							<img src="<?php 
            echo esc_url($module_img);
            ?>
" align="right" width="71" height="45" />
							<p><?php 
            _e('Free', 'jetpack');
            ?>
</p>
						</div>
						
						<p><?php 
            echo apply_filters('jetpack_short_module_description_' . $module, $module_data['description']);
            ?>
</p>
				</div>

				<div class="jetpack-module-actions">
				<?php 
            if ($jetpack_connected) {
                $activated = in_array($module, $active);
                ?>
					<?php 
                if (!$activated) {
                    ?>
						<a href="<?php 
                    echo esc_url($toggle_url);
                    ?>
" class="jetpack-toggle-button<?php 
                    echo 'inactive' == $css ? ' button-primary' : ' button';
                    ?>
"><?php 
                    echo $toggle;
                    ?>
</a>&nbsp;
					<?php 
                }
                ?>
//.........这里部分代码省略.........
开发者ID:sajidsan,项目名称:sajidsan.github.io,代码行数:101,代码来源:jetpack.php

示例7: 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

示例8: module

 /**
  * Manage Jetpack Modules
  *
  * ## OPTIONS
  *
  * list: View all available modules, and their status.
  *
  * activate <module_slug>: Activate a module.
  *
  * deactivate <module_slug>: Deactivate a module.
  *
  * toggle <module_slug>: Toggle a module on or off.
  *
  * ## EXAMPLES
  *
  * wp jetpack module list
  * wp jetpack module activate stats
  * wp jetpack module deactivate stats
  * wp jetpack module toggle stats
  *
  * @synopsis [list|activate|deactivate|toggle [<module_name>]]
  */
 public function module($args, $assoc_args)
 {
     $action = isset($args[0]) ? $args[0] : 'list';
     if (!in_array($action, array('list', 'activate', 'deactivate', 'toggle'))) {
         WP_CLI::error(sprintf(__('%s is not a valid command.', 'jetpack'), $action));
     }
     if (in_array($action, array('activate', 'deactivate', 'toggle'))) {
         if (isset($args[1])) {
             $module_slug = $args[1];
             if (!Jetpack::is_module($module_slug)) {
                 WP_CLI::error(sprintf(__('%s is not a valid module.', 'jetpack'), $module_slug));
             }
             if ('toggle' == $action) {
                 $action = Jetpack::is_module_active($module_slug) ? 'deactivate' : 'activate';
             }
         } else {
             WP_CLI::line(__('Please specify a valid module.', 'jetpack'));
             $action = 'list';
         }
     }
     switch ($action) {
         case 'list':
             WP_CLI::line(__('Available Modules:', 'jetpack'));
             $modules = Jetpack::get_available_modules();
             sort($modules);
             foreach ($modules as $module_slug) {
                 $active = Jetpack::is_module_active($module_slug) ? __('Active', 'jetpack') : __('Inactive', 'jetpack');
                 WP_CLI::line("\t" . str_pad($module_slug, 24) . $active);
             }
             break;
         case 'activate':
             $module = Jetpack::get_module($module_slug);
             Jetpack::log('activate', $module_slug);
             Jetpack::activate_module($module_slug, false);
             WP_CLI::success(sprintf(__('%s has been activated.', 'jetpack'), $module['name']));
             break;
         case 'deactivate':
             $module = Jetpack::get_module($module_slug);
             Jetpack::log('deactivate', $module_slug);
             Jetpack::deactivate_module($module_slug);
             WP_CLI::success(sprintf(__('%s has been deactivated.', 'jetpack'), $module['name']));
             break;
         case 'toggle':
             // Will never happen, should have been handled above and changed to activate or deactivate.
             break;
     }
 }
开发者ID:Nancers,项目名称:Snancy-Website-Files,代码行数:69,代码来源:class.jetpack-cli.php

示例9: sync

 /**
  * Set up all the data and queue it for the outgoing XML-RPC request
  */
 function sync()
 {
     global $wpdb;
     $jetpack = Jetpack::init();
     $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 = compact('modules');
     if (count($this->sync)) {
         foreach ($this->sync as $obj => $data) {
             switch ($obj) {
                 case 'post':
                     $global_post = isset($GLOBALS['post']) ? $GLOBALS['post'] : null;
                     $GLOBALS['post'] = null;
                     foreach ($data as $post => $columns) {
                         $sync_data['post'][$post] = $jetpack->get_post($post, $columns);
                         if (isset($this->post_transitions[$post])) {
                             $sync_data['post'][$post]['transitions'] = $this->post_transitions[$post];
                         } else {
                             $sync_data['post'][$post]['transitions'] = array(false, false);
                         }
                     }
                     $GLOBALS['post'] = $global_post;
                     unset($global_post);
                     break;
                 case 'delete_post':
                     foreach ($data as $post => $true) {
                         $sync_data['delete_post'][$post] = true;
                     }
                     break;
                 case 'comment':
                     $global_comment = isset($GLOBALS['comment']) ? $GLOBALS['comment'] : null;
                     unset($GLOBALS['comment']);
                     foreach ($data as $comment => $columns) {
                         $sync_data['comment'][$comment] = $jetpack->get_comment($comment, $columns);
                     }
                     $GLOBALS['comment'] = $global_comment;
                     unset($global_comment);
                     break;
                 case 'delete_comment':
                     foreach ($data as $comment => $true) {
                         $sync_data['delete_comment'][$comment] = true;
                     }
                     break;
                 case 'tag':
                     foreach ($data as $taxonomy => $columns) {
                         $sync_data['tag'][$taxonomy] = $jetpack->get_taxonomy($taxonomy, $columns, 'post_tag');
                     }
                     break;
                 case 'delete_tag':
                     foreach ($data as $taxonomy => $columns) {
                         $sync_data['delete_tag'][$taxonomy] = $columns;
                     }
                     break;
                 case 'category':
                     foreach ($data as $taxonomy => $columns) {
                         $sync_data['category'][$taxonomy] = $jetpack->get_taxonomy($taxonomy, $columns, 'category');
                     }
                     break;
                 case 'delete_category':
                     foreach ($data as $taxonomy => $columns) {
                         $sync_data['delete_category'][$taxonomy] = $columns;
                     }
                     break;
             }
         }
         Jetpack::xmlrpc_async_call('jetpack.syncContent', $sync_data);
     }
 }
开发者ID:jfitzsimmons,项目名称:hoseb.com,代码行数:76,代码来源:jetpack.php

示例10: get_available_modules

 /**
  * Return Jetpack available modules
  * @since 0.1
  * @return array
  */
 private function get_available_modules()
 {
     if (null === self::$modules) {
         if (class_exists('Jetpack')) {
             //remove_filter( 'jetpack_get_available_modules', array($this, 'blacklist') ); // remove filter useless here because of bug in Jetpack
             $modules = array();
             foreach (Jetpack::get_available_modules() as $slug) {
                 $module = Jetpack::get_module($slug);
                 if ($module) {
                     $modules[$slug] = $module;
                 }
             }
             self::$modules = $modules;
             //add_filter( 'jetpack_get_available_modules', array($this, 'blacklist') );
         } else {
             self::$modules = self::$known_modules;
         }
     }
     return self::$modules;
 }
开发者ID:misfist,项目名称:missdrepants-network,代码行数:25,代码来源:jetpack-module-control.php

示例11: validate_input

 public function validate_input($module)
 {
     $this->modules = Jetpack::get_available_modules();
     return true;
 }
开发者ID:shazadmaved,项目名称:vizblog,代码行数:5,代码来源:class.jetpack-json-api-modules-list-endpoint.php

示例12: generate_stats_array

 public static function generate_stats_array($prefix = '')
 {
     $return = array();
     $return["{$prefix}version"] = JETPACK__VERSION;
     $return["{$prefix}wp-version"] = get_bloginfo('version');
     $return["{$prefix}php-version"] = PHP_VERSION;
     $return["{$prefix}branch"] = floatval(JETPACK__VERSION);
     $return["{$prefix}wp-branch"] = floatval(get_bloginfo('version'));
     $return["{$prefix}php-branch"] = floatval(PHP_VERSION);
     $return["{$prefix}public"] = Jetpack_Options::get_option('public');
     $return["{$prefix}ssl"] = Jetpack::permit_ssl();
     $return["{$prefix}is-https"] = is_ssl() ? 'https' : 'http';
     $return["{$prefix}language"] = get_bloginfo('language');
     $return["{$prefix}charset"] = get_bloginfo('charset');
     $return["{$prefix}is-multisite"] = is_multisite() ? 'multisite' : 'singlesite';
     $return["{$prefix}identitycrisis"] = Jetpack::check_identity_crisis(1) ? 'yes' : 'no';
     $return["{$prefix}plugins"] = implode(',', Jetpack::get_active_plugins());
     $return["{$prefix}single-user-site"] = Jetpack::is_single_user_site();
     $return["{$prefix}manage-enabled"] = Jetpack::is_module_active('manage');
     // is-multi-network can have three values, `single-site`, `single-network`, and `multi-network`
     $return["{$prefix}is-multi-network"] = 'single-site';
     if (is_multisite()) {
         $return["{$prefix}is-multi-network"] = Jetpack::is_multi_network() ? 'multi-network' : 'single-network';
     }
     if (!empty($_SERVER['SERVER_ADDR']) || !empty($_SERVER['LOCAL_ADDR'])) {
         $ip = !empty($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR'];
         $ip_arr = array_map('intval', explode('.', $ip));
         if (4 == count($ip_arr)) {
             $return["{$prefix}ip-2-octets"] = implode('.', array_slice($ip_arr, 0, 2));
         }
     }
     foreach (Jetpack::get_available_modules() as $slug) {
         $return["{$prefix}module-{$slug}"] = Jetpack::is_module_active($slug) ? 'on' : 'off';
     }
     return $return;
 }
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:36,代码来源:class.jetpack-heartbeat.php

示例13: generate_stats_array

 public static function generate_stats_array($prefix = '')
 {
     $return = array();
     $return["{$prefix}version"] = JETPACK__VERSION;
     $return["{$prefix}wp-version"] = get_bloginfo('version');
     $return["{$prefix}php-version"] = PHP_VERSION;
     $return["{$prefix}branch"] = floatval(JETPACK__VERSION);
     $return["{$prefix}wp-branch"] = floatval(get_bloginfo('version'));
     $return["{$prefix}php-branch"] = floatval(PHP_VERSION);
     $return["{$prefix}public"] = Jetpack_Options::get_option('public');
     $return["{$prefix}ssl"] = Jetpack::permit_ssl();
     $return["{$prefix}language"] = get_bloginfo('language');
     $return["{$prefix}charset"] = get_bloginfo('charset');
     $return["{$prefix}is-multisite"] = is_multisite() ? 'multisite' : 'singlesite';
     $return["{$prefix}identitycrisis"] = Jetpack::check_identity_crisis(1) ? 'yes' : 'no';
     $return["{$prefix}plugins"] = implode(',', Jetpack::get_active_plugins());
     switch (Jetpack_Options::get_option('json_api_full_management', null)) {
         case null:
             $return["{$prefix}full_manage"] = 'unset';
             break;
         case false:
             $return["{$prefix}full_manage"] = 'false';
             break;
         case true:
             $return["{$prefix}full_manage"] = 'true';
             break;
         default:
             $return["{$prefix}full_manage"] = Jetpack_Options::get_option('json_api_full_management', null);
     }
     if (!Jetpack_Options::get_option('public')) {
         // Also flag things as private since we don't provide the user with option to easy opt into if the site is private
         $return["{$prefix}full_manage"] = 'private-' . $return["{$prefix}full_manage"];
     }
     // is-multi-network can have three values, `single-site`, `single-network`, and `multi-network`
     $return["{$prefix}is-multi-network"] = 'single-site';
     if (is_multisite()) {
         $return["{$prefix}is-multi-network"] = Jetpack::is_multi_network() ? 'multi-network' : 'single-network';
     }
     if (!empty($_SERVER['SERVER_ADDR']) || !empty($_SERVER['LOCAL_ADDR'])) {
         $ip = !empty($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR'];
         $ip_arr = array_map('intval', explode('.', $ip));
         if (4 == count($ip_arr)) {
             $return["{$prefix}ip-2-octets"] = implode('.', array_slice($ip_arr, 0, 2));
             $return["{$prefix}ip-3-octets"] = implode('.', array_slice($ip_arr, 0, 3));
         }
     }
     foreach (Jetpack::get_available_modules() as $slug) {
         $return["{$prefix}module-{$slug}"] = Jetpack::is_module_active($slug) ? 'on' : 'off';
     }
     return $return;
 }
开发者ID:moushegh,项目名称:blog-source-configs,代码行数:51,代码来源:class.jetpack-heartbeat.php

示例14: features_available

 /**
  * Returns what features are available. Uses the slug of the module files.
  *
  * @return array|IXR_Error
  */
 function features_available()
 {
     $raw_modules = Jetpack::get_available_modules();
     $modules = array();
     foreach ($raw_modules as $module) {
         $modules[] = str_replace(array('/modules/', '.php'), '', $module);
     }
     return $modules;
 }
开发者ID:sajidsan,项目名称:sajidsan.github.io,代码行数:14,代码来源:class.jetpack-xmlrpc-server.php

示例15: is_module

 public static function is_module($module)
 {
     return !empty($module) && !validate_file($module, Jetpack::get_available_modules());
 }
开发者ID:automattic,项目名称:jetpack,代码行数:4,代码来源:class.jetpack.php


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