- Timestamp:
- 01/29/2020 12:43:23 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-plugins-list-table.php
r46755 r47122 187 187 $plugin_data = array_merge( (array) $plugin_info->response[ $plugin_file ], $plugin_data ); 188 188 $plugins['all'][ $plugin_file ] = $plugin_data; 189 // Make sure that $plugins['upgrade'] also receives the extra info since it is used on ?plugin_status=upgrade 189 // Make sure that $plugins['upgrade'] also receives the extra info since it is used on ?plugin_status=upgrade. 190 190 if ( isset( $plugins['upgrade'][ $plugin_file ] ) ) { 191 191 $plugins['upgrade'][ $plugin_file ] = $plugin_data; … … 194 194 $plugin_data = array_merge( (array) $plugin_info->no_update[ $plugin_file ], $plugin_data ); 195 195 $plugins['all'][ $plugin_file ] = $plugin_data; 196 // Make sure that $plugins['upgrade'] also receives the extra info since it is used on ?plugin_status=upgrade 196 // Make sure that $plugins['upgrade'] also receives the extra info since it is used on ?plugin_status=upgrade. 197 197 if ( isset( $plugins['upgrade'][ $plugin_file ] ) ) { 198 198 $plugins['upgrade'][ $plugin_file ] = $plugin_data; … … 200 200 } 201 201 202 // Filter into individual sections 202 // Filter into individual sections. 203 203 if ( is_multisite() && ! $screen->in_admin( 'network' ) && is_network_only_plugin( $plugin_file ) && ! is_plugin_active( $plugin_file ) ) { 204 204 if ( $show_network_active ) { 205 // On the non-network screen, show inactive network-only plugins if allowed 205 // On the non-network screen, show inactive network-only plugins if allowed. 206 206 $plugins['inactive'][ $plugin_file ] = $plugin_data; 207 207 } else { 208 // On the non-network screen, filter out network-only plugins as long as they're not individually active 208 // On the non-network screen, filter out network-only plugins as long as they're not individually active. 209 209 unset( $plugins['all'][ $plugin_file ] ); 210 210 } 211 211 } elseif ( ! $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) { 212 212 if ( $show_network_active ) { 213 // On the non-network screen, show network-active plugins if allowed 213 // On the non-network screen, show network-active plugins if allowed. 214 214 $plugins['active'][ $plugin_file ] = $plugin_data; 215 215 } else { 216 // On the non-network screen, filter out network-active plugins 216 // On the non-network screen, filter out network-active plugins. 217 217 unset( $plugins['all'][ $plugin_file ] ); 218 218 } 219 219 } elseif ( ( ! $screen->in_admin( 'network' ) && is_plugin_active( $plugin_file ) ) 220 220 || ( $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) ) { 221 // On the non-network screen, populate the active list with plugins that are individually activated 222 // On the network -admin screen, populate the active list with plugins that are network activated221 // On the non-network screen, populate the active list with plugins that are individually activated. 222 // On the network admin screen, populate the active list with plugins that are network-activated. 223 223 $plugins['active'][ $plugin_file ] = $plugin_data; 224 224 … … 228 228 } else { 229 229 if ( isset( $recently_activated[ $plugin_file ] ) ) { 230 // Populate the recently activated list with plugins that have been recently activated 230 // Populate the recently activated list with plugins that have been recently activated. 231 231 $plugins['recently_activated'][ $plugin_file ] = $plugin_data; 232 232 } 233 // Populate the inactive list with plugins that aren't activated 233 // Populate the inactive list with plugins that aren't activated. 234 234 $plugins['inactive'][ $plugin_file ] = $plugin_data; 235 235 } … … 252 252 $this->items = array(); 253 253 foreach ( $plugins[ $status ] as $plugin_file => $plugin_data ) { 254 // Translate, Don't Apply Markup, Sanitize HTML254 // Translate, don't apply markup, sanitize HTML. 255 255 $this->items[ $plugin_file ] = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, false, true ); 256 256 } … … 632 632 ); 633 633 634 // Do not restrict by default 634 // Do not restrict by default. 635 635 $restrict_network_active = false; 636 636 $restrict_network_only = false; … … 644 644 $plugin_name .= '<br/>' . $plugin_data['Name']; 645 645 } 646 if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant 646 if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant. 647 647 $is_active = true; 648 648 $description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>'; 649 } elseif ( defined( $dropins[ $plugin_file ][1] ) && constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true 649 } elseif ( defined( $dropins[ $plugin_file ][1] ) && constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true. 650 650 $is_active = true; 651 651 $description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>'; … … 751 751 ); 752 752 } 753 } // end if $is_active754 } // end if $screen->in_admin( 'network' )755 } // end if $context753 } // End if $is_active. 754 } // End if $screen->in_admin( 'network' ). 755 } // End if $context. 756 756 757 757 $actions = array_filter( $actions ); … … 907 907 } 908 908 909 // Details link using API info, if available 909 // Details link using API info, if available. 910 910 if ( isset( $plugin_data['slug'] ) && current_user_can( 'install_plugins' ) ) { 911 911 $plugin_meta[] = sprintf(
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)