Changeset 18655
- Timestamp:
- 09/08/2011 08:07:15 PM (12 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/default-filters.php
r18630 r18655 220 220 add_action( 'wp_print_footer_scripts', '_wp_footer_scripts' ); 221 221 add_action( 'init', 'check_theme_switched', 99 ); 222 add_action( 'after_theme_change', '_wp_sidebars_changed' ); 222 223 223 224 if ( isset( $_GET['replytocom'] ) ) -
trunk/wp-includes/theme.php
r18654 r18655 1994 1994 add_action( 'delete_attachment', '_delete_attachment_theme_mod' ); 1995 1995 1996 ?> 1996 /** 1997 * Checks if a theme has been changed and runs 'after_theme_change' hook on the next WP load 1998 * 1999 * @since 3.3 2000 */ 2001 function check_theme_switched() { 2002 if ( false !== ( $old_theme = get_option( 'theme_switched' ) ) && !empty( $old_theme ) ) { 2003 do_action( 'after_theme_change', $old_theme ); 2004 update_option( 'theme_switched', false ); 2005 } 2006 } -
trunk/wp-includes/widgets.php
r18654 r18655 1195 1195 } 1196 1196 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 */ 1203 function _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(); 1207 1210 } 1208 1211
Note: See TracChangeset
for help on using the changeset viewer.