函数原型
get_allowed_themes(): WP_Theme[]
函数描述
Get the allowed themes for the current site.
是否弃用
Warning: This function has been deprecated. Use wp_get_themes() instead.
函数参数
无
函数返回值
WP_Theme[] Array of WP_Theme objects keyed by their name.
函数位置
File: wp-admin/includes/deprecated.php.
函数源码
function get_allowed_themes() {
_deprecated_function( __FUNCTION__, '3.4.0', "wp_get_themes( array( 'allowed' => true ) )" );
$themes = wp_get_themes( array( 'allowed' => true ) );
$wp_themes = array();
foreach ( $themes as $theme ) {
$wp_themes[ $theme->get('Name') ] = $theme;
}
return $wp_themes;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.4.0 | Use wp_get_themes() |
| 3.0.0 | Introduced. |

