deleted_blog
云策文档标注
概述
deleted_blog 是一个 WordPress 钩子,在站点从网络中删除后触发,用于执行相关清理或通知操作。此钩子自 5.1.0 版本起已被弃用,建议开发者使用替代方案。
关键要点
- 触发时机:站点从网络删除后立即执行
- 参数:$site_id(站点ID,整数类型)和 $drop(布尔值,指示是否删除站点表,默认为 false)
- 弃用状态:自 WordPress 5.1.0 版本起弃用,推荐使用更新钩子或函数
- 相关函数:wp_delete_site() 和 wpmu_delete_blog() 用于删除站点
注意事项
- 此钩子已弃用,新开发中应避免使用,并检查是否有替代钩子或方法
- 参数 $drop 控制是否物理删除数据库表,需谨慎设置以避免数据丢失
原文内容
Fires after the site is deleted from the network.
Parameters
$site_idint-
The site ID.
$dropbool-
True if site’s tables should be dropped. Default false.
Source
do_action_deprecated( 'deleted_blog', array( $old_site->id, true ), '5.1.0' );