after_populate_network
云策文档标注
概述
after_populate_network 是一个 WordPress Hook,在网络完全填充后触发,用于在创建网络后执行自定义操作。
关键要点
- 触发时机:在网络完全填充后立即执行。
- 参数:包括 $network_id(网络ID)、$domain(域名)、$email(管理员邮箱)、$site_name(网络名称)、$path(路径)和 $subdomain_install(是否为子域名安装)。
- 用途:常用于扩展网络设置或执行后续任务。
- 相关函数:与 populate_network() 函数关联,用于填充网络设置。
- 版本:从 WordPress 6.9.0 版本引入。
代码示例
do_action( 'after_populate_network', $network_id, $domain, $email, $site_name, $path, $subdomain_install );
原文内容
Fires after a network is fully populated.
Parameters
$network_idint-
ID of network created.
$domainstring-
The domain name for the network.
$emailstring-
Email address for the network administrator.
$site_namestring-
The name of the network.
$pathstring-
The path to append to the network’s domain name.
$subdomain_installbool-
Whether the network is a subdomain installation or a subdirectory installation.
Source
do_action( 'after_populate_network', $network_id, $domain, $email, $site_name, $path, $subdomain_install );
Changelog
| Version | Description |
|---|---|
| 6.9.0 | Introduced. |