get_theme()
get_theme( string $theme )
检索主题数据。
Retrieve theme data.
说明(Description)
另见
获取主题()
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$theme | (string) | 必需 | 主题名称。 |
返回(Return)
(array|null)如果主题名不存在,则为空。主题数据(array|null)。
源码(Source)
/** * Retrieve theme data. * * @since 1.5.0 * @deprecated 3.4.0 * @deprecated Use wp_get_theme() * @see wp_get_theme() * * @param string $theme Theme name. * @return array|null Null, if theme name does not exist. Theme data, if exists. */ function get_theme( $theme ) { _deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme( $stylesheet )' ); $themes = get_themes(); if ( is_array( $themes ) && array_key_exists( $theme, $themes ) ) return $themes[ $theme ]; return null; }
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
3.4.0 | wp-includes/deprecated.php:2919 | 0 | 2 |
get_theme() 为WP2原创文章,链接:https://www.wp2.cn/functions/get_theme/