Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



after_switch_theme ›

Seit3.3.0
Veraltetn/v
do_action( 'after_switch_theme', $old_theme->get( 'Name' )
Parameter: (2)
  • (string) $old_name Old theme name.
    Erforderlich: Ja
  • (WP_Theme) $old_theme WP_Theme instance of the old theme.
    Erforderlich: Ja
Definiert in:
Codex:

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.





Quellcode

do_action( 'after_switch_theme', $old_theme->get( 'Name' ), $old_theme );