s/can_edit_site/can_edit_network/g. see #15720.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16833 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8ba8d20f16
commit
8d00b7b63b
|
@ -217,7 +217,7 @@ class WP_MS_Users_List_Table extends WP_List_Table {
|
||||||
echo "<td $attributes>";
|
echo "<td $attributes>";
|
||||||
if ( is_array( $blogs ) ) {
|
if ( is_array( $blogs ) ) {
|
||||||
foreach ( (array) $blogs as $key => $val ) {
|
foreach ( (array) $blogs as $key => $val ) {
|
||||||
if ( !can_edit_site( $val->site_id ) )
|
if ( !can_edit_network( $val->site_id ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$path = ( $val->path == '/' ) ? '' : $val->path;
|
$path = ( $val->path == '/' ) ? '' : $val->path;
|
||||||
|
|
|
@ -722,14 +722,14 @@ function revoke_super_admin( $user_id ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Whether or not we can edit this site from this page
|
* Whether or not we can edit this network 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
|
* By default editing of network is restricted to the Network Admin for that site_id this allows for this to be overridden
|
||||||
*
|
*
|
||||||
* @since 3.1.0
|
* @since 3.1.0
|
||||||
* @param integer $site_id The site id to check.
|
* @param integer $site_id The network/site id to check.
|
||||||
*/
|
*/
|
||||||
function can_edit_site( $site_id ) {
|
function can_edit_network( $site_id ) {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
if ($site_id == $wpdb->siteid )
|
if ($site_id == $wpdb->siteid )
|
||||||
|
@ -737,6 +737,6 @@ function can_edit_site( $site_id ) {
|
||||||
else
|
else
|
||||||
$result = false;
|
$result = false;
|
||||||
|
|
||||||
return apply_filters( 'can_edit_site', $result, $site_id );
|
return apply_filters( 'can_edit_network', $result, $site_id );
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -22,7 +22,7 @@ if ( ! $id )
|
||||||
wp_die( __('Invalid site ID.') );
|
wp_die( __('Invalid site ID.') );
|
||||||
|
|
||||||
$details = get_blog_details( $id );
|
$details = get_blog_details( $id );
|
||||||
if ( !can_edit_site( $details->site_id ) )
|
if ( !can_edit_network( $details->site_id ) )
|
||||||
wp_die( __( 'You do not have permission to access this page.' ) );
|
wp_die( __( 'You do not have permission to access this page.' ) );
|
||||||
|
|
||||||
$is_main_site = is_main_site( $id );
|
$is_main_site = is_main_site( $id );
|
||||||
|
|
|
@ -22,7 +22,7 @@ if ( ! $id )
|
||||||
wp_die( __('Invalid site ID.') );
|
wp_die( __('Invalid site ID.') );
|
||||||
|
|
||||||
$details = get_blog_details( $id );
|
$details = get_blog_details( $id );
|
||||||
if ( !can_edit_site( $details->site_id ) )
|
if ( !can_edit_network( $details->site_id ) )
|
||||||
wp_die( __( 'You do not have permission to access this page.' ) );
|
wp_die( __( 'You do not have permission to access this page.' ) );
|
||||||
|
|
||||||
$is_main_site = is_main_site( $id );
|
$is_main_site = is_main_site( $id );
|
||||||
|
|
|
@ -31,7 +31,7 @@ if ( ! $id )
|
||||||
$wp_list_table->prepare_items();
|
$wp_list_table->prepare_items();
|
||||||
|
|
||||||
$details = get_blog_details( $id );
|
$details = get_blog_details( $id );
|
||||||
if ( !can_edit_site( $details->site_id ) )
|
if ( !can_edit_network( $details->site_id ) )
|
||||||
wp_die( __( 'You do not have permission to access this page.' ) );
|
wp_die( __( 'You do not have permission to access this page.' ) );
|
||||||
|
|
||||||
$is_main_site = is_main_site( $id );
|
$is_main_site = is_main_site( $id );
|
||||||
|
|
|
@ -28,7 +28,7 @@ if ( ! $id )
|
||||||
wp_die( __('Invalid site ID.') );
|
wp_die( __('Invalid site ID.') );
|
||||||
|
|
||||||
$details = get_blog_details( $id );
|
$details = get_blog_details( $id );
|
||||||
if ( !can_edit_site( $details->site_id ) )
|
if ( !can_edit_network( $details->site_id ) )
|
||||||
wp_die( __( 'You do not have permission to access this page.' ) );
|
wp_die( __( 'You do not have permission to access this page.' ) );
|
||||||
|
|
||||||
$is_main_site = is_main_site( $id );
|
$is_main_site = is_main_site( $id );
|
||||||
|
|
Loading…
Reference in New Issue