can_edit_network()
Determines whether or not this network from this page can be edited.
By default editing of network is restricted to the Network Admin for that $network_id. This function allows for this to be overridden.
Hooks from the function
Returns
true|false. True if network can be edited, false otherwise.
Usage
can_edit_network( $network_id );
- $network_id(int) (required)
- The network ID to check.
Changelog
| Since 3.1.0 | Introduced. |
can_edit_network() can edit network code WP 7.0
function can_edit_network( $network_id ) {
if ( get_current_network_id() === (int) $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 );
}