Make WordPress Core

Changeset 31673


Ignore:
Timestamp:
03/08/2015 02:09:25 AM (10 years ago)
Author:
jeremyfelt
Message:

Introduce delete_site meta capability.

Map delete_site as a meta capability to manage_options so that the ability to delete sites can be more granularly managed for individual site administrators on a multisite network.

Props thomaswm.

Fixes #30470.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/menu.php

    r31427 r31673  
    229229    $submenu['tools.php'][15] = array( __('Export'), 'export', 'export.php' );
    230230    if ( is_multisite() && !is_main_site() )
    231         $submenu['tools.php'][25] = array( __('Delete Site'), 'manage_options', 'ms-delete-site.php' );
     231        $submenu['tools.php'][25] = array( __('Delete Site'), 'delete_site', 'ms-delete-site.php' );
    232232    if ( ! is_multisite() && defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE )
    233233        $submenu['tools.php'][50] = array(__('Network Setup'), 'manage_options', 'network.php');
  • trunk/src/wp-admin/ms-delete-site.php

    r31403 r31673  
    1313    wp_die( __( 'Multisite support is not enabled.' ) );
    1414
    15 // @todo Create a delete blog cap.
    16 if ( ! current_user_can( 'manage_options' ) )
     15if ( ! current_user_can( 'delete_site' ) )
    1716    wp_die(__( 'You do not have sufficient permissions to delete this site.'));
    1817
  • trunk/src/wp-includes/capabilities.php

    r31555 r31673  
    13461346        $caps[] = 'edit_theme_options';
    13471347        break;
     1348    case 'delete_site':
     1349        $caps[] = 'manage_options';
     1350        break;
    13481351    default:
    13491352        // Handle meta capabilities for custom post types.
Note: See TracChangeset for help on using the changeset viewer.