get_theme

函数
get_theme ( $theme )
参数
  • (string) $theme Theme name.
    Required:
返回值
  • (array|null) Null, if theme name does not exist. Theme data, if exists.
相关
  • wp_get_theme()
定义位置
相关方法
get_themesget_the_timewp_get_themeget_termget_theme_mod
引入
1.5.0
弃用
3.4.0

get_theme: 这个函数用来获取当前的主题对象。它可以接受一个字符串参数作为主题名称或主题目录路径。如果没有提供参数,该函数将返回基于当前使用的模板的当前主题对象。

检索主题数据。

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;
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-05 19:32:59

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: