get_allowed_themes

Advertisement

Deprecated Deprecated

This function has been deprecated. Use wp_get_themes() instead.

Summery Summery

Get the allowed themes for the current site.

Syntax Syntax

get_allowed_themes()

Return Return

(WP_Theme[]) Array of WP_Theme objects keyed by their name.

Source Source

File: wp-admin/includes/deprecated.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;
}

Advertisement

Changelog Changelog

Changelog
Version Description
3.4.0 Use wp_get_themes()
3.0.0 Introduced.

See also See also

Advertisement

Leave a Reply