函数原型
get_theme( string $theme ): array|null
函数描述
Retrieve theme data.
是否弃用
Warning: This function has been deprecated. Use wp_get_theme() instead.
函数参数
-
$theme
string
Required - Theme name.
函数返回值
array|null Null, if theme name does not exist. Theme data, if exists.
函数位置
File: wp-includes/deprecated.php.
函数源码
function get_theme( $theme ) {
_deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme( $stylesheet )' );
$themes = get_themes();
if ( is_array( $themes ) && array_key_exists( $theme, $themes ) )
return $themes[ $theme ];
return null;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.4.0 | Use wp_get_theme() |
| 1.5.0 | Introduced. |

