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

原型

get_allowed_themes()

返回值

(array)  $ themes允许的主题数组。

源文件

路径:wp-admin/includes/deprecated.php

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

其他

英文文档:https://developer.wordpress.org/reference/functions/get_allowed_themes/