get_allowed_themes

函数
get_allowed_themes ( No parameters )
返回值
  • (WP_Theme[]) Array of WP_Theme objects keyed by their name.
相关
  • wp_get_themes()
定义位置
相关方法
get_site_allowed_themeswpmu_get_blog_allowedthemesget_allowed_mime_typesget_broken_themesget_allowed_block_types
引入
3.0.0
弃用
3.4.0

get_allowed_themes: 此函数返回一个允许在网站上使用的主题数组。

获取当前网站允许的主题。

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

常见问题

FAQs
查看更多 >
闪电侠

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

2025-12-05 17:32:57

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

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

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