diff --git a/src/wp-admin/includes/admin-filters.php b/src/wp-admin/includes/admin-filters.php
index e80c111dde..03e6f0264a 100644
a
|
b
|
add_action( 'install_plugins_recommended', 'display_plugins_table' ); |
103 | 103 | add_action( 'install_plugins_new', 'display_plugins_table' ); |
104 | 104 | add_action( 'install_plugins_beta', 'display_plugins_table' ); |
105 | 105 | add_action( 'install_plugins_favorites', 'display_plugins_table' ); |
| 106 | add_action( 'install_plugins_plugin-list', 'display_plugins_table' ); |
106 | 107 | add_action( 'install_plugins_pre_plugin-information', 'install_plugin_information' ); |
107 | 108 | |
108 | 109 | // Template hooks. |
diff --git a/src/wp-admin/includes/class-wp-plugin-install-list-table.php b/src/wp-admin/includes/class-wp-plugin-install-list-table.php
index 3c8dc1d2bb..e987228ae2 100644
a
|
b
|
class WP_Plugin_Install_List_Table extends WP_List_Table { |
121 | 121 | $tabs['upload'] = __( 'Upload Plugin' ); |
122 | 122 | } |
123 | 123 | |
124 | | $nonmenu_tabs = array( 'plugin-information' ); // Valid actions to perform which do not have a Menu item. |
| 124 | // Valid actions to perform which do not have a Menu item. |
| 125 | $nonmenu_tabs = array( |
| 126 | 'plugin-information', |
| 127 | 'plugin-list', |
| 128 | ); |
125 | 129 | |
126 | 130 | /** |
127 | 131 | * Filters the tabs shown on the Add Plugins screen. |
… |
… |
class WP_Plugin_Install_List_Table extends WP_List_Table { |
149 | 153 | |
150 | 154 | $installed_plugins = $this->get_installed_plugins(); |
151 | 155 | |
| 156 | if ( 'plugin-list' === $tab && empty( $_REQUEST['plugin'] ) ) { |
| 157 | $tab = ''; |
| 158 | } |
| 159 | |
152 | 160 | $args = array( |
153 | 161 | 'page' => $paged, |
154 | 162 | 'per_page' => $per_page, |
… |
… |
class WP_Plugin_Install_List_Table extends WP_List_Table { |
208 | 216 | add_action( 'install_plugins_favorites', 'install_plugins_favorites_form', 9, 0 ); |
209 | 217 | break; |
210 | 218 | |
| 219 | case 'plugin-list': |
| 220 | $args['plugins'] = array_map( 'trim', explode( ',', wp_unslash( $_REQUEST['plugin'] ) ) ); |
| 221 | break; |
| 222 | |
211 | 223 | default: |
212 | 224 | $args = false; |
213 | 225 | break; |
… |
… |
class WP_Plugin_Install_List_Table extends WP_List_Table { |
238 | 250 | return; |
239 | 251 | } |
240 | 252 | |
241 | | $api = plugins_api( 'query_plugins', $args ); |
| 253 | if ( 'plugin-list' === $tab ) { |
| 254 | if ( empty( $args['plugins'] ) ) { |
| 255 | return; |
| 256 | } |
242 | 257 | |
243 | | if ( is_wp_error( $api ) ) { |
244 | | $this->error = $api; |
245 | | return; |
246 | | } |
| 258 | foreach ( $args['plugins'] as $slug ) { |
| 259 | $plugin_info = plugins_api( 'plugin_information', (object) array( 'slug' => $slug ) ); |
247 | 260 | |
248 | | $this->items = $api->plugins; |
| 261 | if ( is_wp_error( $plugin_info ) ) { |
| 262 | continue; |
| 263 | } |
249 | 264 | |
250 | | if ( $this->orderby ) { |
251 | | uasort( $this->items, array( $this, 'order_callback' ) ); |
252 | | } |
| 265 | $this->items[] = $plugin_info; |
| 266 | } |
253 | 267 | |
254 | | $this->set_pagination_args( |
255 | | array( |
256 | | 'total_items' => $api->info['results'], |
257 | | 'per_page' => $args['per_page'], |
258 | | ) |
259 | | ); |
| 268 | $this->set_pagination_args( |
| 269 | array( |
| 270 | 'total_items' => count( $this->items ), |
| 271 | 'per_page' => $per_page, |
| 272 | ) |
| 273 | ); |
| 274 | } else { |
| 275 | $api = plugins_api( 'query_plugins', $args ); |
260 | 276 | |
261 | | if ( isset( $api->info['groups'] ) ) { |
262 | | $this->groups = $api->info['groups']; |
| 277 | if ( is_wp_error( $api ) ) { |
| 278 | $this->error = $api; |
| 279 | return; |
| 280 | } |
| 281 | |
| 282 | $this->items = $api->plugins; |
| 283 | |
| 284 | if ( $this->orderby ) { |
| 285 | uasort( $this->items, array( $this, 'order_callback' ) ); |
| 286 | } |
| 287 | |
| 288 | $this->set_pagination_args( |
| 289 | array( |
| 290 | 'total_items' => $api->info['results'], |
| 291 | 'per_page' => $args['per_page'], |
| 292 | ) |
| 293 | ); |
| 294 | |
| 295 | if ( isset( $api->info['groups'] ) ) { |
| 296 | $this->groups = $api->info['groups']; |
| 297 | } |
263 | 298 | } |
264 | 299 | |
265 | 300 | if ( $installed_plugins ) { |