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

get_allowed_themes() WordPress Function

The get_allowed_themes() function is used to retrieve an array of all the themes that are currently allowed on the site. This array can be used to determine which themes are available for use on the site.

get_allowed_themes() #

Get the allowed themes for the current site.


Description

Top ↑

See also


Top ↑

Return

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


Top ↑

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


Top ↑

Changelog

Changelog
VersionDescription
3.4.0Use wp_get_themes()
3.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More