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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: