WordPress.org

Make WordPress Core

Ticket #15669: 15669.patch

File 15669.patch, 2.1 KB (added by ocean90, 4 years ago)
  • wp-includes/ms-admin-bar.php

     
    3333                        $current_blog->domain 
    3434                ); 
    3535 
    36         $mature_url = network_admin_url( "edit.php?action=confirm&action2={$matureaction}&id={$current_blog->blog_id}&msg=" . urlencode( $maturetext_confirm ) ); 
    37         $suspend_url = network_admin_url( "edit.php?action=confirm&action2={$suspendaction}&id={$current_blog->blog_id}&msg=" . urlencode( $suspendtext_confirm ) ); 
     36        $mature_url = wp_nonce_url( network_admin_url( "edit.php?action=confirm&action2={$matureaction}&id={$current_blog->blog_id}&msg=" . urlencode( $maturetext_confirm ) ), 'confirm' ); 
     37        $suspend_url = wp_nonce_url( network_admin_url( "edit.php?action=confirm&action2={$suspendaction}&id={$current_blog->blog_id}&msg=" . urlencode( $suspendtext_confirm ) ), 'confirm' ); 
    3838 
    3939        /* Add the submenu items to the Super Admin menu */ 
    4040        $wp_admin_bar->add_menu( array( 'parent' => 'superadmin', 'title' => __( 'Network Admin' ), 'href' => network_admin_url(), 'position' => 5, ) ); 
    4141        $wp_admin_bar->add_menu( array( 'parent' => 'superadmin', 'title' => __( 'Site Admin' ), 'href' => admin_url(), 'position' => 10, ) ); 
    4242        $wp_admin_bar->add_menu( array( 'parent' => 'superadmin', 'title' => __( 'Site Options' ), 'href' => network_admin_url( "site-info.php?id={$current_blog->blog_id}" ), 'position' => 30, ) ); 
    4343        $wp_admin_bar->add_menu( array( 'parent' => 'superadmin', 'title' => ( $current_blog->mature ? __('Unmark as mature') : __('Mark as mature') ), 'href' => $mature_url, 'position' => 50, ) ); 
    44         $wp_admin_bar->add_menu( array( 'parent' => 'superadmin', 'title' => ( $current_blog->spam ? __('Unsuspend site') : __('Suspend site') ), 'href' => $suspend_url, 'position' => 80, ) ); 
     44 
     45        if ( ! is_main_site( $current_blog->blog_id ) ) 
     46                $wp_admin_bar->add_menu( array( 'parent' => 'superadmin', 'title' => ( $current_blog->spam ? __('Unsuspend site') : __('Suspend site') ), 'href' => $suspend_url, 'position' => 80, ) ); 
    4547} 
    4648 
    4749?>