Ticket #20104: 20104.3.diff
File 20104.3.diff, 3.6 KB (added by , 9 years ago) |
---|
-
src/wp-admin/css/list-tables.css
869 869 padding: 2px 0 0; 870 870 } 871 871 872 .row-actions .network_active { 873 color: #000; 874 } 875 872 876 tr:hover .row-actions, 873 877 .mobile .row-actions, 874 878 .row-actions.visible, -
src/wp-admin/includes/class-wp-plugins-list-table.php
127 127 } 128 128 } 129 129 130 if ( ! $screen->in_admin( 'network' ) ) { 131 $show = current_user_can( 'manage_network_plugins' ); 132 /** 133 * Filter whether to display network-activated plugins alongside site-activated plugins. 134 * 135 * @since 4.4.0 136 * 137 * @param bool $show Whether to show network-active plugins. Default is whether the current 138 * user can manage network plugins (ie. a Super Admin). 139 */ 140 $show_network_active = apply_filters( 'show_network_active_plugins', $show ); 141 } 142 130 143 set_transient( 'plugin_slugs', array_keys( $plugins['all'] ), DAY_IN_SECONDS ); 131 144 132 145 if ( $screen->in_admin( 'network' ) ) { … … 171 184 // On the non-network screen, filter out network-only plugins as long as they're not individually activated 172 185 unset( $plugins['all'][ $plugin_file ] ); 173 186 } elseif ( ! $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) { 174 // On the non-network screen, filter out network activated plugins 175 unset( $plugins['all'][ $plugin_file ] ); 187 if ( $show_network_active ) { 188 // On the non-network screen, show network-activated plugins if allowed 189 $plugins['active'][ $plugin_file ] = $plugin_data; 190 } else { 191 // On the non-network screen, filter out network activated plugins 192 unset( $plugins['all'][ $plugin_file ] ); 193 } 176 194 } elseif ( ( ! $screen->in_admin( 'network' ) && is_plugin_active( $plugin_file ) ) 177 195 || ( $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) ) { 178 196 // On the non-network screen, populate the active list with plugins that are individually activated … … 492 510 else 493 511 $is_active = is_plugin_active( $plugin_file ); 494 512 513 $is_network_active = is_plugin_active_for_network( $plugin_file ); 514 495 515 if ( $screen->in_admin( 'network' ) ) { 496 516 if ( $is_active ) { 497 517 if ( current_user_can( 'manage_network_plugins' ) ) { … … 509 529 } 510 530 } 511 531 } else { 512 if ( $is_active ) { 532 if ( $is_network_active ) { 533 $actions = array( 534 'network_active' => __( 'Network Active' ), 535 ); 536 } elseif ( $is_active ) { 513 537 /* translators: %s: plugin name */ 514 538 $actions['deactivate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( __( 'Deactivate %s' ), $plugin_data['Name'] ) ) . '">' . __( 'Deactivate' ) . '</a>'; 515 539 } else { … … 582 606 583 607 $class = $is_active ? 'active' : 'inactive'; 584 608 $checkbox_id = "checkbox_" . md5($plugin_data['Name']); 585 if ( in_array( $status, array( 'mustuse', 'dropins' ) ) ) {609 if ( $is_network_active || in_array( $status, array( 'mustuse', 'dropins' ) ) ) { 586 610 $checkbox = ''; 587 611 } else { 588 612 $checkbox = "<label class='screen-reader-text' for='" . $checkbox_id . "' >" . sprintf( __( 'Select %s' ), $plugin_data['Name'] ) . "</label>"