WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/08/2011 08:07:15 PM (10 years ago)
Author:
azaozz
Message:

Make check_theme_switched() run an action so this enhancement is available to plugins and themes too, see #17979

File:
1 edited

Legend:

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

    r18654 r18655  
    11951195}
    11961196
    1197 function check_theme_switched() {
    1198     if ( false !== ( $old_theme = get_option( 'theme_switched' ) ) && !empty( $old_theme ) ) {
    1199         global $sidebars_widgets;
    1200 
    1201         if ( ! is_array( $sidebars_widgets ) )
    1202             $sidebars_widgets = wp_get_sidebars_widgets();
    1203 
    1204         retrieve_widgets();
    1205         update_option( 'theme_switched', false );
    1206     }
     1197/**
     1198 * Handle sidebars config after theme change
     1199 *
     1200 * @access private
     1201 * @since 3.3
     1202 */ 
     1203function _wp_sidebars_changed() {
     1204    global $sidebars_widgets;
     1205
     1206    if ( ! is_array( $sidebars_widgets ) )
     1207        $sidebars_widgets = wp_get_sidebars_widgets();
     1208
     1209    retrieve_widgets();
    12071210}
    12081211
Note: See TracChangeset for help on using the changeset viewer.