get_allowed_themes

The timeline below displays how wordpress function get_allowed_themes has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.4

/**
 * Get the allowed themes for the current site.
 *
 * @since 3.0.0
 * @deprecated 3.4.0 Use wp_get_themes()
 * @see wp_get_themes()
 *
 * @return WP_Theme[] Array of WP_Theme objects keyed by their name.
 */
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;
}

WordPress Version: 4.6

/**
 * Get the allowed themes for the current site.
 *
 * @since 3.0.0
 * @deprecated 3.4.0 Use wp_get_themes()
 * @see wp_get_themes()
 *
 * @return array $themes Array of 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;
}

WordPress Version: 4.5

/**
 * Get the allowed themes for the current site.
 *
 * @since 3.0.0
 * @deprecated 3.4.0 Use wp_get_themes()
 * @see wp_get_themes()
 *
 * @return array $themes Array of allowed themes.
 */
function get_allowed_themes()
{
    _deprecated_function(__FUNCTION__, '3.4', "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;
}

WordPress Version: 4.4

/**
 * Get the allowed themes for the current blog.
 *
 * @since 3.0.0
 * @deprecated 3.4.0 Use wp_get_themes()
 * @see wp_get_themes()
 *
 * @return array $themes Array of allowed themes.
 */
function get_allowed_themes()
{
    _deprecated_function(__FUNCTION__, '3.4', "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;
}

WordPress Version: 3.7

/**
 * Get the allowed themes for the current blog.
 *
 * @since 3.0.0
 * @deprecated 3.4.0
 * @deprecated Use wp_get_themes()
 * @see wp_get_themes()
 *
 * @return array $themes Array of allowed themes.
 */
function get_allowed_themes()
{
    _deprecated_function(__FUNCTION__, '3.4', "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;
}