do_action( 'after_switch_theme', string $old_name, WP_Theme $old_theme )
- Since
- 3.3.0
Fires on the next WP load after the theme has been switched.
Description
The parameters differ according to whether the old theme exists or not.
If the old theme is missing, the old name will instead be the slug of the old theme.
See 'switch_theme'.
Parameters
$old_namestring- Old theme name.
$old_themeWP_Theme- WP_Theme instance of the old theme.
Fired at · 2
wp-includes/theme.php:3516check_theme_switched()wp-includes/theme.php:3519check_theme_switched()
Source
* * @since 3.3.0 * * @param string $old_name Old theme name. * @param WP_Theme $old_theme WP_Theme instance of the old theme. */ do_action( 'after_switch_theme', $old_theme->get( 'Name' ), $old_theme ); } else { /** This action is documented in wp-includes/theme.php */ do_action( 'after_switch_theme', $stylesheet, $old_theme ); } flush_rewrite_rules();History
Introduced in 3.3.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.9.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.