after_switch_theme
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
do_action( 'after_switch_theme', string $old_name, WP_Theme $old_theme )
Описание
Параметры различаются в зависимости от того, существует старая тема или нет.
Если старая тема отсутствует, вместо её имени будет использован слаг старой темы.
См. ‘switch_theme’.
Оригинал (английский)
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 ‘switch_theme’.
Параметры
$old_name
string
обязательный
$old_theme
WP_Theme
обязательный
Исходный код
wp-includes/theme.php:3502
do_action( 'after_switch_theme', $old_theme->get( 'Name' ), $old_theme );
История изменений
| Версия | Описание |
|---|---|
| 3.3.0 | Introduced. |

