Skip to content

Commit f2359ee

Browse files
committed
Plugins: Hide the search form on the Favorites tab.
The plugin search form does not apply to the Favorites tab, which instead expects a WordPress.org username to look up a user's favorited plugins. Rendering the term-based search form there was misleading. Update `WP_Plugin_Install_List_Table::views()` to read the global `$tab` and skip `install_search_form()` when the favorites tab is active, while leaving the form in place on the Featured, Popular, and Recommended tabs. Developed in WordPress#11457. Props manishxdp, bor0, westonruter, shailu25, sabbir1991. Fixes #65026. git-svn-id: https://develop.svn.wordpress.org/trunk@62448 602fd350-edb4-49c9-b593-d223f7449a82
1 parent da7588b commit f2359ee

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/wp-admin/includes/class-wp-plugin-install-list-table.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,12 @@ protected function get_views() {
331331

332332
/**
333333
* Overrides parent views so we can use the filter bar display.
334+
*
335+
* @global string $tab The current tab.
334336
*/
335337
public function views() {
338+
global $tab;
339+
336340
$views = $this->get_views();
337341

338342
/** This filter is documented in wp-admin/includes/class-wp-list-table.php */
@@ -358,7 +362,11 @@ public function views() {
358362
?>
359363
</ul>
360364

361-
<?php install_search_form(); ?>
365+
<?php
366+
if ( 'favorites' !== $tab ) {
367+
install_search_form();
368+
}
369+
?>
362370
</div>
363371
<?php
364372
}

0 commit comments

Comments
 (0)