wpseek.com
WordPress开发者和主题制作者的搜索引擎



after_switch_theme › WordPress动作钩子

Since3.3.0
已弃用n/a
› do_action( 'after_switch_theme', $old_theme->get( 'Name' )
参数: (2)
  • () old_name Old theme name.
    Required: Yes
  • () old_theme WP_Theme instance of the old theme.
    Required: Yes
定义在:
文档:

Fires on the next WP load after the theme has been switched.

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 {@see 'switch_theme'}.




源码

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