switch_theme action-hook . WP 1.5.0
Fires after the theme is switched.
Usage
add_action( 'switch_theme', 'action_function_name_5614', 10, 3 ); function action_function_name_5614( $new_name, $new_theme, $old_theme ){ // action... }
- $new_name(string)
- Name of the new theme.
- $new_theme(WP_Theme)
- WP_Theme instance of the new theme.
- $old_theme(WP_Theme)
- WP_Theme instance of the old theme.
Changelog
Since 1.5.0 | Introduced. |
Since 4.5.0 | Introduced the $old_theme parameter. |
Where the hook is called
switch_theme
wp-includes/theme.php 829
do_action( 'switch_theme', $new_name, $new_theme, $old_theme );