mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Make check_theme_switched() run an action so this enhancement is available to plugins and themes too, see #17979
git-svn-id: https://develop.svn.wordpress.org/trunk@18655 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1993,4 +1993,14 @@ function _delete_attachment_theme_mod( $id ) {
|
||||
|
||||
add_action( 'delete_attachment', '_delete_attachment_theme_mod' );
|
||||
|
||||
?>
|
||||
/**
|
||||
* Checks if a theme has been changed and runs 'after_theme_change' hook on the next WP load
|
||||
*
|
||||
* @since 3.3
|
||||
*/
|
||||
function check_theme_switched() {
|
||||
if ( false !== ( $old_theme = get_option( 'theme_switched' ) ) && !empty( $old_theme ) ) {
|
||||
do_action( 'after_theme_change', $old_theme );
|
||||
update_option( 'theme_switched', false );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user