本文整理汇总了PHP中WP_Theme::get_files方法的典型用法代码示例。如果您正苦于以下问题:PHP WP_Theme::get_files方法的具体用法?PHP WP_Theme::get_files怎么用?PHP WP_Theme::get_files使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WP_Theme
的用法示例。
在下文中一共展示了WP_Theme::get_files方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* Get Available css themes
*
* Function is not intended to be called directly. Use `wprainbow_get_available_themes()` instead.
*
* @use private
*
* @return array Assoc containing all avaliable themes with theme slugs as key and prettified theme slugs values.
*/
function get_available_themes()
{
$theme_instance = new WP_Theme('themes', plugin_dir_path(__FILE__) . 'css');
$css_files = $theme_instance->get_files('css');
$themes = array();
foreach ($css_files as $filename => $path) {
$filename = basename($filename, '.css');
$themes[$filename] = ucwords(str_replace('-', ' ', $filename));
}
return apply_filters('wprainbow_available_themes', $themes);
}