get_allowed_themes

Get the allowed themes for the current site.

Description

(array) get_allowed_themes(); 

Returns (array)

$themes Array of allowed themes.


Usage

  1. if ( !function_exists( 'get_allowed_themes' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/deprecated.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = get_allowed_themes(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/deprecated.php  
  1. function get_allowed_themes() { 
  2. _deprecated_function( __FUNCTION__, '3.4.0', "wp_get_themes( array( 'allowed' => true ) )" ); 
  3.  
  4. $themes = wp_get_themes( array( 'allowed' => true ) ); 
  5.  
  6. $wp_themes = array(); 
  7. foreach ( $themes as $theme ) { 
  8. $wp_themes[ $theme->get('Name') ] = $theme; 
  9.  
  10. return $wp_themes;