Make WordPress Core


Ignore:
Timestamp:
02/29/2012 08:07:22 PM (14 years ago)
Author:
nacin
Message:

Deprecate get_current_theme(). Use (string) wp_get_theme() to get the translated name of the theme. Keep the current_theme option for now. see #20103, see #20138.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/deprecated.php

    r20029 r20040  
    29172917 *
    29182918 * @since 1.5.0
    2919  * @global array $wp_themes Stores the working themes.
     2919 * @deprecated 3.4.0
     2920 * @deprecated Use wp_get_themes()
     2921 * @see wp_get_themes()
    29202922 *
    29212923 * @return array Theme list with theme data.
     
    29422944 *
    29432945 * @since 1.5.0
     2946 * @deprecated 3.4.0
     2947 * @deprecated Use wp_get_theme()
     2948 * @see wp_get_theme()
    29442949 *
    29452950 * @param string $theme Theme name.
     
    29512956    $themes = get_themes();
    29522957    if ( is_array( $themes ) && array_key_exists( $theme, $themes ) )
    2953         return $themes[$theme];
     2958        return $themes[ $theme ];
    29542959    return null;
    29552960}
     2961
     2962/**
     2963 * Retrieve current theme name.
     2964 *
     2965 * @since 1.5.0
     2966 * @deprecated 3.4.0
     2967 * @deprecated Use (string) wp_get_theme()
     2968 * @see wp_get_theme()
     2969 *
     2970 * @return string
     2971 */
     2972function get_current_theme() {
     2973    _deprecated_function( __FUNCTION__, '3.4', 'get_current_theme()' );
     2974
     2975    if ( $theme = get_option( 'current_theme' ) )
     2976        return $theme;
     2977
     2978    return wp_get_theme()->get('Name');
     2979}
Note: See TracChangeset for help on using the changeset viewer.