Changeset 16764
- Timestamp:
- 12/07/2010 02:28:40 PM (13 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-ms-users-list-table.php
r16607 r16764 218 218 if ( is_array( $blogs ) ) { 219 219 foreach ( (array) $blogs as $key => $val ) { 220 if ( $current_site->id != $val->site_id ) continue; 221 222 $path = ( $val->path == '/' ) ? '' : $val->path; 220 if ( !can_edit_site( $val->site_id ) ) 221 continue; 222 223 $path = ( $val->path == '/' ) ? '' : $val->path; 223 224 echo '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . str_replace( '.' . $current_site->domain, '', $val->domain . $path ) . '</a>'; 224 echo ' <small class="row-actions ">';225 echo ' <small class="row-actions site-' . $val->site_id . '">'; 225 226 $actions = array(); 226 227 $actions['edit'] = '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . __( 'Edit' ) . '</a>'; -
trunk/wp-admin/includes/ms.php
r16748 r16764 722 722 return false; 723 723 } 724 /** 725 * Whether or not we can edit this site from this page 726 * 727 * By default editing of sites is restricted to the Network Admin for that site_id this allows for this to be overridden 728 * 729 * @since 3.1.0 730 * @param integer $site_id The site id to check. 731 */ 732 function can_edit_site( $site_id ) { 733 global $wpdb; 734 735 if ($site_id == $wpdb->siteid ) 736 $result = true; 737 else 738 $result = false; 739 740 return apply_filters( 'can_edit_site', $result, $site_id ); 741 } 724 742 ?> -
trunk/wp-admin/network/site-info.php
r16627 r16764 23 23 24 24 $details = get_blog_details( $id ); 25 if ( $details->site_id != $wpdb->siteid)25 if ( !can_edit_site( $details->site_id ) ) 26 26 wp_die( __( 'You do not have permission to access this page.' ) ); 27 27 -
trunk/wp-admin/network/site-options.php
r16627 r16764 23 23 24 24 $details = get_blog_details( $id ); 25 if ( $details->site_id != $wpdb->siteid)25 if ( !can_edit_site( $details->site_id ) ) 26 26 wp_die( __( 'You do not have permission to access this page.' ) ); 27 27 -
trunk/wp-admin/network/site-themes.php
r16606 r16764 32 32 33 33 $details = get_blog_details( $id ); 34 if ( $details->site_id != $wpdb->siteid)34 if ( !can_edit_site( $details->site_id ) ) 35 35 wp_die( __( 'You do not have permission to access this page.' ) ); 36 36 -
trunk/wp-admin/network/site-users.php
r16586 r16764 29 29 30 30 $details = get_blog_details( $id ); 31 if ( $details->site_id != $wpdb->siteid)31 if ( !can_edit_site( $details->site_id ) ) 32 32 wp_die( __( 'You do not have permission to access this page.' ) ); 33 33
Note: See TracChangeset
for help on using the changeset viewer.