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


PHP get_broken_themes函数代码示例

本文整理汇总了PHP中get_broken_themes函数的典型用法代码示例。如果您正苦于以下问题:PHP get_broken_themes函数的具体用法?PHP get_broken_themes怎么用?PHP get_broken_themes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: get_themes

 /**
  * Gets the currently available themes.
  *
  * @return array The currently available themes
  */
 public function get_themes()
 {
     $this->_pre_search($this->get_theme_dirs());
     $options = array('errors' => null, 'allowed' => null);
     $theme_map = null;
     if (function_exists('wp_get_themes')) {
         $theme_map = wp_get_themes($options);
     } else {
         $theme_map = get_themes() + get_broken_themes();
     }
     add_filter('theme_root_uri', array($this, 'get_root_uri_for_our_themes'), 10, 3);
     foreach ($theme_map as $theme) {
         $theme->get_theme_root_uri();
     }
     $this->_post_search();
     return $theme_map;
 }
开发者ID:sedici,项目名称:wpmu-istec,代码行数:22,代码来源:search.php

示例2: get_themes

 /**
  * get_themes method
  *
  * Wrapper to WP `wp_get_themes` or `get_themes` (whichever is available).
  * Method resets global variables and hooks, required for indexing, whilst
  * performing theme search. After themes are found - it caches these using
  * local static variable and restores global functions.
  *
  * @param bool $force Set to true to re-list themes
  *
  * @return array Map of theme names and their paths
  */
 public function get_themes($force = false, $options = array())
 {
     static $theme_map = array();
     $key = json_encode($options);
     if ($force || !isset($theme_map[$key])) {
         global $wp_theme_directories, $wp_broken_themes;
         $restore_vals = array('wp_theme_directories' => array(AI1EC_THEMES_ROOT), 'wp_broken_themes' => array());
         // mark restore point
         foreach ($restore_vals as $key => $cval) {
             $restore_vals[$key] = ${$key};
             ${$key} = $cval;
         }
         // disable and clean cache
         add_filter('wp_cache_themes_persistently', '__return_false', 1);
         search_theme_directories(true);
         $theme_list = NULL;
         if (function_exists('wp_get_themes')) {
             $theme_list = wp_get_themes($options);
         } else {
             if (isset($options['errors']) && $options['errors']) {
                 $theme_list = get_broken_themes();
             } else {
                 $theme_list = get_themes();
             }
         }
         foreach ($theme_list as $theme) {
             $theme_map[$key][$theme->get('Name')] = $theme;
             $theme->get_theme_root_uri();
             // pre-cache
         }
         unset($theme_list);
         // remove cache disablers and restore values
         remove_filter('wp_cache_themes_persistently', '__return_false', 1);
         foreach ($restore_vals as $key => $cval) {
             ${$key} = $cval;
         }
         search_theme_directories(true);
     }
     return $theme_map[$key];
 }
开发者ID:briancompton,项目名称:knightsplaza,代码行数:52,代码来源:class-ai1ec-themes-list-table.php

示例3: get_broken_themes

<br class="clear" />

<?php 
}
?>

<?php 
$wp_list_table->display();
?>

</form>
<br class="clear" />

<?php 
// List broken themes, if any.
$broken_themes = get_broken_themes();
if (current_user_can('edit_themes') && count($broken_themes)) {
    ?>

<h3><?php 
    _e('Broken Themes');
    ?>
</h3>
<p><?php 
    _e('The following themes are installed but incomplete. Themes must have a stylesheet and a template.');
    ?>
</p>

<table id="broken-themes">
	<tr>
		<th><?php 
开发者ID:nuevomediagroup,项目名称:WordPress,代码行数:31,代码来源:themes.php

示例4: test_broken_themes

 /**
  * @expectedDeprecated get_themes
  * @expectedDeprecated get_broken_themes
  */
 function test_broken_themes()
 {
     $themes = get_themes();
     $expected = array('broken-theme' => array('Name' => 'broken-theme', 'Title' => 'broken-theme', 'Description' => __('Stylesheet is missing.')));
     $this->assertEquals($expected, get_broken_themes());
 }
开发者ID:atimmer,项目名称:wordpress-develop-mirror,代码行数:10,代码来源:themeDir.php


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