Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

WordPress hook directory
after_switch_theme

Description

Runs when the blog's theme is changed. Action function argument: name of the new theme. If used in a theme, it only works if the theme that adds action is the one being enabled. Can be used to run certain code when enabling a theme.

This description was scraped automatically from the WordPress filter reference or action reference. If it looks like this is the wrong description, please tell me so I can fix my code.

WordPress version history for after_switch_theme

This database has information for all major versions from WP 1.2.1 through 6.2.

Version File Line Type
3.3 wp-includes/theme.php 2007 View in context action
3.4 wp-includes/theme.php 1566 View in context action
3.4 wp-includes/theme.php 1568 View in context action
3.5 wp-includes/theme.php 1613 View in context action
3.5 wp-includes/theme.php 1615 View in context action
3.6 wp-includes/theme.php 1615 View in context action
3.6 wp-includes/theme.php 1617 View in context action
3.7 wp-includes/theme.php 1642 View in context action
3.7 wp-includes/theme.php 1644 View in context action
3.8 wp-includes/theme.php 1781 View in context action
3.8 wp-includes/theme.php 1784 View in context action
3.9 wp-includes/theme.php 1832 View in context action
3.9 wp-includes/theme.php 1835 View in context action
4.0 wp-includes/theme.php 1883 View in context action
4.0 wp-includes/theme.php 1886 View in context action
4.1 wp-includes/theme.php 1905 View in context action
4.1 wp-includes/theme.php 1908 View in context action
4.2 wp-includes/theme.php 1918 View in context action
4.2 wp-includes/theme.php 1921 View in context action
4.3 wp-includes/theme.php 1876 View in context action
4.3 wp-includes/theme.php 1879 View in context action
4.4 wp-includes/theme.php 1974 View in context action
4.4 wp-includes/theme.php 1977 View in context action
4.5 wp-includes/theme.php 2028 View in context action
4.5 wp-includes/theme.php 2031 View in context action
4.6 wp-includes/theme.php 2054 View in context action
4.6 wp-includes/theme.php 2057 View in context action
4.7 wp-includes/theme.php 2728 View in context action
4.7 wp-includes/theme.php 2731 View in context action
4.8 wp-includes/theme.php 2749 View in context action
4.8 wp-includes/theme.php 2752 View in context action
4.9 wp-includes/theme.php 2748 View in context action
4.9 wp-includes/theme.php 2751 View in context action
5.0 wp-includes/theme.php 2753 View in context action
5.0 wp-includes/theme.php 2756 View in context action
5.1 wp-includes/theme.php 2899 View in context action
5.1 wp-includes/theme.php 2902 View in context action
5.2 wp-includes/theme.php 2907 View in context action
5.2 wp-includes/theme.php 2910 View in context action
5.3 wp-includes/theme.php 2964 View in context action
5.3 wp-includes/theme.php 2967 View in context action
5.4 wp-includes/theme.php 2974 View in context action
5.4 wp-includes/theme.php 2977 View in context action
5.5 wp-includes/theme.php 3267 View in context action
5.5 wp-includes/theme.php 3270 View in context action
5.6 wp-includes/theme.php 3279 View in context action
5.6 wp-includes/theme.php 3282 View in context action
5.7 wp-includes/theme.php 3302 View in context action
5.7 wp-includes/theme.php 3305 View in context action
5.8 wp-includes/theme.php 3301 View in context action
5.8 wp-includes/theme.php 3304 View in context action
5.9 wp-includes/theme.php 3365 View in context action
5.9 wp-includes/theme.php 3368 View in context action
6.0 wp-includes/theme.php 3377 View in context action
6.0 wp-includes/theme.php 3380 View in context action
6.1 wp-includes/theme.php 3395 View in context action
6.1 wp-includes/theme.php 3398 View in context action
6.2 wp-includes/theme.php 3401 View in context action
6.2 wp-includes/theme.php 3404 View in context action

Related Hooks

We find related hooks using word stems. after_switch_theme has 3 significant word stem(s): after, switch, theme. Note that some of the hooks below may not appear in all versions of WP.