check_theme_switched

Definition:
function check_theme_switched() {}

Checks if a theme has been changed and runs ‘after_switch_theme’ hook on the next WP load

Defined actions

  • after_switch_theme
    do_action( 'after_switch_theme', $old_theme );

Source code

function check_theme_switched() {

	if ( false !== ( $old_theme = get_option( 'theme_switched' ) ) && !empty( $old_theme ) ) {

		do_action( 'after_switch_theme', $old_theme );

		update_option( 'theme_switched', false );

	}

}

15864

No comments yet... Be the first to leave a reply!

Leave a comment