From c1bd9e3795a2d8637c80257bdc4b9fc66180618d Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 27 Nov 2012 16:08:35 +0000 Subject: [PATCH] Show plugin activation message when activating a network only plugin on a single site installation. Props nacin fixes #22576 git-svn-id: http://core.svn.wordpress.org/trunk@22871 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/plugins.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index 33a2110968..7fc30363d3 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -30,6 +30,11 @@ if ( $action ) { if ( ! current_user_can('activate_plugins') ) wp_die(__('You do not have sufficient permissions to activate plugins for this site.')); + if ( is_multisite() && ! is_network_admin() && is_network_only_plugin( $plugin ) ) { + wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") ); + exit; + } + check_admin_referer('activate-plugin_' . $plugin); $result = activate_plugin($plugin, self_admin_url('plugins.php?error=true&plugin=' . $plugin), is_network_admin() ); @@ -44,11 +49,6 @@ if ( $action ) { } if ( ! is_network_admin() ) { - if ( is_network_only_plugin( $plugin ) ) { - wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") ); - exit; - } - $recent = (array) get_option( 'recently_activated' ); unset( $recent[ $plugin ] ); update_option( 'recently_activated', $recent );