• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress core a2z

WordPress core a2z

WordPress core only

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / Hooks / after_switch_theme – action

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.

Parameters

.
( 3.3.0 ) . .
( string ) $old_name Old theme name. . . .
$old_theme
( WP_Theme ) WP_Theme instance of the old theme. . . .
Hook name: after_switch_theme
Hook type: action
Plugin ref: WordPress
Sourcefile:
File ref: wp-includes/default-filters.php
Description: Sets up the default filters and actions for most of the WordPress hooks. If you need to remove a default hook, this file will give you the priority for which to use to remove the hook.

Not all of the default hooks are found in default-filters.php

Parameters:
Deprecated?: No
API Letters: A,S,T

Invokers

1 to 1 of 1
  • check_theme_switched() – Checks if a theme has been changed and runs ‘after_switch_theme’ hook on the next WP load.

Implementers

    Published: 25th November 2019 | Last updated: 9th December 2020

    Primary Sidebar

    Information

    Hook name: after_switch_theme
    Hook type: action
    Plugin ref: WordPress
    Sourcefile:
    File ref: wp-includes/default-filters.php
    Description: Sets up the default filters and actions for most of the WordPress hooks. If you need to remove a default hook, this file will give you the priority for which to use to remove the hook. Not all of the default hooks are found in default-filters.php
    Parameters:
    Deprecated?: No
    API Letters: A,S,T

    Footer

    WP-a2z
    WordPress core a2z
    WordPress core only
    WordPress 5.6.2
    WordPress a2z
    WordPress core a2z
    Genesis Theme Framework a2z
    Jetpack a2z
    WordPress develop tests
    Easy Digital Downloads a2z
    WooCommerce a2z
    Yoast SEO a2z
    WordPress Blocks

    Site:  core.wp-a2z.org
    © Copyright WP-a2z 2014-2021. All rights reserved.


    Website designed and developed by Herb Miller
    Proudly powered by WordPress and oik plugins

    • Home
    • Blog
    • Sitemap
    • Sites