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/theme.php

    r18654 r18655  
    19941994add_action( 'delete_attachment', '_delete_attachment_theme_mod' );
    19951995
    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 */   
     2001function 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}
Note: See TracChangeset for help on using the changeset viewer.