mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 21:00:21 +00:00
Introduce can_edit_site to replace inline checks on whether or not the site_id is for the current Network. See #15716.
git-svn-id: https://develop.svn.wordpress.org/trunk@16764 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -721,4 +721,22 @@ function revoke_super_admin( $user_id ) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Whether or not we can edit this site from this page
|
||||
*
|
||||
* By default editing of sites is restricted to the Network Admin for that site_id this allows for this to be overridden
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param integer $site_id The site id to check.
|
||||
*/
|
||||
function can_edit_site( $site_id ) {
|
||||
global $wpdb;
|
||||
|
||||
if ($site_id == $wpdb->siteid )
|
||||
$result = true;
|
||||
else
|
||||
$result = false;
|
||||
|
||||
return apply_filters( 'can_edit_site', $result, $site_id );
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user