[wp-trac] [WordPress Trac] #60495: Following "plugins_list": Add a filter in get_views() in class-wp-plugins-list-table
WordPress Trac
noreply at wordpress.org
Fri Sep 19 14:05:56 UTC 2025
#60495: Following "plugins_list": Add a filter in get_views() in class-wp-plugins-
list-table
-------------------------+---------------------
Reporter: juliobox | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.9
Component: Plugins | Version: 6.3
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-------------------------+---------------------
Changes (by mindctrl):
* keywords: has-patch changes-requested => has-patch
Comment:
== Test Report
=== Description
✅ This report validates that PR 9284 works as expected.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/8294
=== Environment
- WordPress: 6.9-alpha-60093-src
- PHP: 8.2.29
- Server: nginx/1.29.1
- Database: mysqli (Server: 8.4.6 / Client: mysqlnd 8.2.29)
- Browser: Chrome 140.0.0.0
- OS: macOS
- Theme: Twenty Twenty-Five 1.2
- MU Plugins:
* phpmailer.php
* z.php
- Plugins:
* Test Reports 1.2.0
=== Actual Results
1. ✅ Issue resolved with patch.
=== Additional Notes
I tested the included PR with the following custom code, which adds a new
status view called "My Plugins", adds the Test Reports and Hello Dolly
plugins to that view, and unsets those same plugins from the All view.
{{{
add_filter( 'plugins_list', 'my_plugins_tab' );
function my_plugins_tab( $plugins ) {
$plugins['my_plugins']['test-reports/test-reports.php'] =
$plugins['all']['test-reports/test-reports.php'];
$plugins['my_plugins']['hello.php'] =
$plugins['all']['hello.php'];
unset( $plugins['all']['test-reports/test-reports.php'] );
unset( $plugins['all']['hello.php'] );
return $plugins;
}
add_filter( 'plugins_list_status_text', 'my_plugins_tab_label', 10, 3 );
function my_plugins_tab_label( $text, $count, $type ) {
if ( 'my_plugins' === $type ) {
$text = _nx( 'My Plugin', 'My Plugins', $count, 'my-
custom-text-domain' );
}
return $text;
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60495#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list