我们是否可以从此页面编辑此网络。
原型
can_edit_network( int $network_id )
描述
默认情况下,网络编辑仅限于该$ network_id的网络管理员。此功能允许覆盖此功能。
参数
$network_id
(int)
(Required)
要检查的网络ID。
返回值
(bool)
如果可以编辑网络,则为True,否则为false。
源文件
路径:wp-admin/includes/ms.php
<?php
...
function can_edit_network( $network_id ) {
if ( $network_id == get_current_network_id() )
$result = true;
else
$result = false;
/**
* Filters whether this network can be edited from this page.
*
* @since 3.1.0
*
* @param bool $result Whether the network can be edited from this page.
* @param int $network_id The network ID to check.
*/
return apply_filters( 'can_edit_network', $result, $network_id );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/can_edit_network/