• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_broken_themes函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_browser函数代码示例发布时间:2022-05-15
下一篇:
PHP get_breadcrumbs函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap