WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/07/2010 11:11:19 PM (9 years ago)
Author:
ryan
Message:

Don't show Suspend/Unsuspend links for the main site on the admin bar. Props ocean90. fixes #15669

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-admin-bar.php

    r16438 r16781  
    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 */
     
    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
Note: See TracChangeset for help on using the changeset viewer.