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

Line Code
1998 add_action( 'delete_attachment', '_delete_attachment_theme_mod' );
1999
2000 /**
2001  * Checks if a theme has been changed and runs 'after_switch_theme' hook on the next WP load
2002  *
2003  * @since 3.3
2004  */
2005 function check_theme_switched() {
2006      if ( false !== ( $old_theme = get_option( 'theme_switched' ) ) && !empty( $old_theme ) ) {
2007           do_action( 'after_switch_theme', $old_theme );
2008           update_option( 'theme_switched', false );
2009      }
2010 }
2011