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
This commit is contained in:
Ryan Boren 2012-11-27 16:08:35 +00:00
parent 374bf89c49
commit c1bd9e3795
1 changed files with 5 additions and 5 deletions

View File

@ -30,6 +30,11 @@ if ( $action ) {
if ( ! current_user_can('activate_plugins') ) if ( ! current_user_can('activate_plugins') )
wp_die(__('You do not have sufficient permissions to activate plugins for this site.')); 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); check_admin_referer('activate-plugin_' . $plugin);
$result = activate_plugin($plugin, self_admin_url('plugins.php?error=true&plugin=' . $plugin), is_network_admin() ); $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_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' ); $recent = (array) get_option( 'recently_activated' );
unset( $recent[ $plugin ] ); unset( $recent[ $plugin ] );
update_option( 'recently_activated', $recent ); update_option( 'recently_activated', $recent );