wp_update_site
云策文档标注
概述
wp_update_site 是一个 WordPress 动作钩子,在数据库中的站点更新后触发。它允许开发者在站点更新时执行自定义代码。
关键要点
- 这是一个动作钩子,用于在站点更新后执行操作。
- 钩子传递两个参数:$new_site(新的 WP_Site 对象)和 $old_site(旧的 WP_Site 对象)。
- 钩子通过 do_action('wp_update_site', $new_site, $old_site) 调用。
- 首次引入于 WordPress 5.1.0 版本。
代码示例
do_action( 'wp_update_site', $new_site, $old_site );
原文内容
Fires once a site has been updated in the database.
Parameters
Source
do_action( 'wp_update_site', $new_site, $old_site );
Changelog
| Version | Description |
|---|---|
| 5.1.0 | Introduced. |