函数原型
get_themes(): array
函数描述
Retrieve list of themes with theme data in theme directory.
是否弃用
Warning: This function has been deprecated. Use wp_get_themes() instead.
函数参数
无
函数返回值
array Theme list with theme data.
函数位置
File: wp-includes/deprecated.php.
函数源码
function get_themes() {
_deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_themes()' );
global $wp_themes;
if ( isset( $wp_themes ) )
return $wp_themes;
$themes = wp_get_themes();
$wp_themes = array();
foreach ( $themes as $theme ) {
$name = $theme->get('Name');
if ( isset( $wp_themes[ $name ] ) )
$wp_themes[ $name . '/' . $theme->get_stylesheet() ] = $theme;
else
$wp_themes[ $name ] = $theme;
}
return $wp_themes;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.4.0 | Use wp_get_themes() |
| 1.5.0 | Introduced. |

