Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: after_switch_theme

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
1557  * Checks if a theme has been changed and runs 'after_switch_theme' hook on the next WP load
1558  *
1559  * @since 3.3.0
1560  */
1561 function check_theme_switched() {
1562      if ( $stylesheet = get_option( 'theme_switched' ) ) {
1563           $old_theme = wp_get_theme( $stylesheet );
1564
1565           if ( $old_theme->exists() )
1566                do_action( 'after_switch_theme', $old_theme->get('Name'), $old_theme );
1567           else
1568                do_action( 'after_switch_theme', $stylesheet );
1569
1570           update_option( 'theme_switched', false );
1571      }
1572 }
1573
1574 /**
1575  * Includes and instantiates the WP_Customize_Manager class.
1576  *
1577  * Fires when ?wp_customize=on or on wp-admin/customize.php.