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
Source
do_action( 'after_switch_theme', $old_theme->get( 'Name' ), $old_theme );
Changelog
Version | Description |
---|---|
3.3.0 | Introduced. |
Example migrated from Codex:
Add options for your theme and set them to their default values.
Update the default medium image size when a theme is activated.