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


PHP Jetpack::get_translated_modules方法代码示例

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


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

示例1: __construct

 function __construct()
 {
     parent::__construct();
     Jetpack::init();
     // In WP 4.2 WP_List_Table will be sanitizing which values are __set()
     global $wp_version;
     if (version_compare($wp_version, '4.2-z', '>=') && $this->compat_fields && is_array($this->compat_fields)) {
         array_push($this->compat_fields, 'all_items');
     }
     $this->items = $this->all_items = Jetpack_Admin::init()->get_modules();
     $this->items = $this->filter_displayed_table_items($this->items);
     /**
      * Filters the list of modules available to be displayed in the Jetpack Settings screen.
      *
      * @since 3.0.0
      *
      * @param array $this->items Array of Jetpack modules.
      */
     $this->items = apply_filters('jetpack_modules_list_table_items', $this->items);
     $this->_column_headers = array($this->get_columns(), array(), array(), 'name');
     $modal_info = isset($_GET['info']) ? $_GET['info'] : false;
     wp_register_script('models.jetpack-modules', plugins_url('_inc/jetpack-modules.models.js', JETPACK__PLUGIN_FILE), array('backbone', 'underscore'), JETPACK__VERSION);
     wp_register_script('views.jetpack-modules', plugins_url('_inc/jetpack-modules.views.js', JETPACK__PLUGIN_FILE), array('backbone', 'underscore', 'wp-util'), JETPACK__VERSION);
     wp_register_script('jetpack-modules-list-table', plugins_url('_inc/jetpack-modules.js', JETPACK__PLUGIN_FILE), array('views.jetpack-modules', 'models.jetpack-modules', 'jquery'), JETPACK__VERSION, true);
     wp_localize_script('jetpack-modules-list-table', 'jetpackModulesData', array('modules' => Jetpack::get_translated_modules($this->all_items), 'i18n' => array('search_placeholder' => __('Search Modules…', 'jetpack')), 'modalinfo' => $this->module_info_check($modal_info, $this->all_items), 'nonces' => array('bulk' => wp_create_nonce('bulk-jetpack_page_jetpack_modules')), 'coreIconAvailable' => Jetpack::jetpack_site_icon_available_in_core()));
     wp_enqueue_script('jetpack-modules-list-table');
     /**
      * Filters the js_templates callback value.
      *
      * @since 3.6.0
      *
      * @param array array( $this, 'js_templates' ) js_templates callback.
      */
     add_action('admin_footer', apply_filters('jetpack_modules_list_table_js_template_callback', array($this, 'js_templates')), 9);
 }
开发者ID:pcuervo,项目名称:wp-carnival,代码行数:35,代码来源:class.jetpack-modules-list-table.php

示例2: page_admin_scripts

 function page_admin_scripts()
 {
     // Enqueue jp.js and localize it
     wp_enqueue_script('jetpack-js', plugins_url('_inc/jp.js', JETPACK__PLUGIN_FILE), array('jquery', 'wp-util'), JETPACK__VERSION . '-20121111');
     wp_localize_script('jetpack-js', 'jetpackL10n', array('ays_disconnect' => __("This will deactivate all Jetpack modules.\nAre you sure you want to disconnect?", 'jetpack'), 'ays_unlink' => __("This will prevent user-specific modules such as Publicize, Notifications and Post By Email from working.\nAre you sure you want to unlink?", 'jetpack'), 'ays_dismiss' => __("This will deactivate Jetpack.\nAre you sure you want to deactivate Jetpack?", 'jetpack'), 'view_all_features' => __('View all Jetpack features', 'jetpack'), 'no_modules_found' => sprintf(__('Sorry, no modules were found for the search term "%s"', 'jetpack'), '{term}'), 'modules' => Jetpack::get_translated_modules(array_values(Jetpack_Admin::init()->get_modules())), 'currentVersion' => JETPACK__VERSION, 'ajaxurl' => admin_url('admin-ajax.php'), 'show_jumpstart' => $this->jetpack_show_jumpstart(), 'activate_nonce' => wp_create_nonce('jetpack-jumpstart-nonce'), 'admin_nonce' => wp_create_nonce('jetpack-admin-nonce'), 'jumpstart_stats_urls' => $this->build_jumpstart_stats_urls(array('dismiss', 'jumpstarted', 'learnmore', 'viewed', 'manual')), 'admin_stats_urls' => $this->build_nux_admin_stats_urls(array('enabled', 'deactivated', 'learnmore')), 'site_url_manage' => Jetpack::build_raw_urls(get_site_url())));
 }
开发者ID:elliott-stocks,项目名称:jetpack,代码行数:6,代码来源:class.jetpack-landing-page.php

示例3: get_modules

 /**
  * Get a list of all Jetpack modules and their information.
  *
  * @since 4.3.0
  *
  * @return array Array of Jetpack modules.
  */
 public function get_modules()
 {
     require_once JETPACK__PLUGIN_DIR . 'class.jetpack-admin.php';
     $modules = Jetpack_Admin::init()->get_modules();
     foreach ($modules as $slug => $properties) {
         $modules[$slug]['options'] = Jetpack_Core_Json_Api_Endpoints::prepare_options_for_response($slug);
         if (isset($modules[$slug]['requires_connection']) && $modules[$slug]['requires_connection'] && Jetpack::is_development_mode()) {
             $modules[$slug]['activated'] = false;
         }
     }
     $modules = Jetpack::get_translated_modules($modules);
     return Jetpack_Core_Json_Api_Endpoints::prepare_modules_for_response($modules);
 }
开发者ID:netmagik,项目名称:netmagik,代码行数:20,代码来源:class.jetpack-core-api-module-endpoints.php


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