|wp-includes/theme.php: check_theme_switched()|| |
Checks if a theme has been changed and runs ‘after_switch_theme’ hook on the next WP load.
Fires on the first WP load after a theme switch if the old theme still exists.
This action fires multiple times and the parameters differs according to the context, if the old theme exists or not. If the old theme is missing, the parameter will be the slug of the old theme.
Callback functions attached to this hook are only triggered in the theme (and/or child theme) being activated. To do things when your theme is deactivated, use switch_theme.
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.