From 597627fb920246d02088e11beb57d398ca6f3621 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sun, 4 Dec 2016 22:07:39 +0000 Subject: [PATCH] Role/Capability: Don't assign the `delete_site` capability to anyone on single site installs. This capability is not relevant on single site installs; it only applies to deleting a site on a multisite installation. Fixes #38326 Built from https://develop.svn.wordpress.org/trunk@39494 git-svn-id: http://core.svn.wordpress.org/trunk@39434 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/capabilities.php | 6 +++++- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index c1e644a85f..308c7063c8 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -422,7 +422,11 @@ function map_meta_cap( $cap, $user_id ) { $caps[] = 'edit_theme_options'; break; case 'delete_site': - $caps[] = 'manage_options'; + if ( is_multisite() ) { + $caps[] = 'manage_options'; + } else { + $caps[] = 'do_not_allow'; + } break; case 'edit_term': case 'delete_term': diff --git a/wp-includes/version.php b/wp-includes/version.php index a2158beebc..0e60e1b2aa 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-39493'; +$wp_version = '4.8-alpha-39494'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.