Make WordPress Core


Ignore:
Timestamp:
10/29/2010 07:09:04 PM (14 years ago)
Author:
scribu
Message:

Fix bulk actions for Network Admin -> plugins. See #14435

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/list-table-plugins.php

    r16061 r16089  
    254254
    255255        $actions = array();
    256         if ( 'active' != $status )
    257             $actions['activate-selected'] = __( 'Activate' );
    258         if ( is_multisite() && 'network' != $status )
    259             $actions['network-activate-selected'] = __( 'Network Activate' );
     256
     257        if ( 'active' != $status ) {
     258            $action = is_network_admin() ? 'network-activate-selected' : 'activate-selected';
     259            $actions[ $action ] = __( 'Activate' );
     260        }
     261
    260262        if ( 'inactive' != $status && 'recent' != $status )
    261263            $actions['deactivate-selected'] = __( 'Deactivate' );
    262         if ( current_user_can( 'update_plugins' ) )
    263             $actions['update-selected'] = __( 'Update' );
    264         if ( current_user_can( 'delete_plugins' ) && ( 'active' != $status ) )
    265             $actions['delete-selected'] = __( 'Delete' );
    266            
    267         if ( is_multisite() && !is_network_admin() ) {
    268             unset( $actions['network-activate-selected'] );
    269             unset( $actions['update-selected'] );
    270             unset( $actions['delete-selected'] );
     264
     265        if ( !is_multisite() || is_network_admin() ) {
     266            if ( current_user_can( 'update_plugins' ) )
     267                $actions['update-selected'] = __( 'Update' );
     268            if ( current_user_can( 'delete_plugins' ) && ( 'active' != $status ) )
     269                $actions['delete-selected'] = __( 'Delete' );
    271270        }
    272271
Note: See TracChangeset for help on using the changeset viewer.