Changeset 20040
- Timestamp:
- 02/29/2012 08:07:22 PM (13 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/deprecated.php
r20029 r20040 2917 2917 * 2918 2918 * @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() 2920 2922 * 2921 2923 * @return array Theme list with theme data. … … 2942 2944 * 2943 2945 * @since 1.5.0 2946 * @deprecated 3.4.0 2947 * @deprecated Use wp_get_theme() 2948 * @see wp_get_theme() 2944 2949 * 2945 2950 * @param string $theme Theme name. … … 2951 2956 $themes = get_themes(); 2952 2957 if ( is_array( $themes ) && array_key_exists( $theme, $themes ) ) 2953 return $themes[ $theme];2958 return $themes[ $theme ]; 2954 2959 return null; 2955 2960 } 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 */ 2972 function 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 } -
trunk/wp-includes/theme.php
r20033 r20040 355 355 } 356 356 return $theme_roots; 357 }358 359 /**360 * Retrieve current theme display name.361 *362 * If the 'current_theme' option has already been set, then it will be returned363 * instead. If it is not set, then each theme will be iterated over until both364 * the current stylesheet and current template name.365 *366 * @since 1.5.0367 *368 * @return string369 */370 function get_current_theme() {371 if ( $theme = get_option( 'current_theme' ) )372 return $theme;373 374 return wp_get_theme()->get('Name');375 357 } 376 358 … … 792 774 $theme_slug = get_option( 'stylesheet' ); 793 775 if ( false === ( $mods = get_option( "theme_mods_$theme_slug" ) ) ) { 794 $theme_name = get_current_theme(); 776 $theme_name = get_option( 'current_theme' ); 777 if ( false === $theme_name ) 778 $theme_name = wp_get_theme()->get('Name'); 795 779 $mods = get_option( "mods_$theme_name" ); // Deprecated location. 796 780 if ( is_admin() && false !== $mods ) { … … 879 863 function remove_theme_mods() { 880 864 delete_option( 'theme_mods_' . get_option( 'stylesheet' ) ); 881 delete_option( 'mods_' . get_current_theme() ); 865 866 // Old style. 867 $theme_name = get_option( 'current_theme' ); 868 if ( false === $theme_name ) 869 $theme_name = wp_get_theme()->get('Name'); 870 delete_option( 'mods_' . $theme_name ); 882 871 } 883 872
Note: See TracChangeset
for help on using the changeset viewer.