[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
Wed Feb 4 05:05:38 UTC 2026


#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:  7.0
Component:  Plugins                  |     Version:  6.3
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch has-test-info  |     Focuses:
-------------------------------------+---------------------
Changes (by huzaifaalmesbah):

 * keywords:  has-patch needs-testing => has-patch has-test-info


Comment:

 === Patch Testing Report

 Patch Tested: https://github.com/WordPress/wordpress-develop/pull/10333

 === Environment
 - WordPress: 7.0-alpha-61215-src
 - PHP: 8.2.30
 - Server: nginx/1.29.4
 - Database: mysqli (Server: 9.5.0 / Client: mysqlnd 8.2.30)
 - Browser: Chrome 144.0.0.0
 - OS: macOS
 - Theme: Twenty Ten 4.5
 - MU Plugins:
   * test-plugins-tab.php
 - Plugins:
   * Classic Editor 1.6.7
   * Hello Dolly 1.7.2
   * Test Reports 1.2.1

 === Steps taken

 1. Created a clean WordPress trunk install.
 2. Activated several plugins such as Classic Editor, Hello Dolly, and Test
 Reports.
 3. Added an MU plugin with:
 {{{
    add_filter( 'plugins_list', function( $plugins ) {
        $first = array_key_first( $plugins['all'] );
        if ( $first ) {
            $plugins['my_plugins'][ $first ] = $plugins['all'][ $first ];
        }
        return $plugins;
    });
 }}}


 4. Visited /wp-admin/plugins.php.
  - Before patch: No new tab is created for `my_plugins`
 5. Applied PR.
 6. Reloaded the Plugins screen.
  - After patch:
   - A new tab is created for `my_plugins`
   - Count is correct
   - Clicking the tab properly filters the plugin list

 7. Added label filter:

 {{{
    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;
    }
 }}}


 8. Reloaded page again.

 9. ✅ Create a Tab and working properly.

 === Expected result
 - Custom statuses added via `plugins_list` should appear as tabs
 - Tabs should correctly filter plugins
 - Tab label should be customizable via `plugins_list_status_text`

 === Screenshots/Screencast with results
 Before and after behavior video: https://files.catbox.moe/ws4bjo.mp4

 === Support Content

 MU plugin used:


 {{{
 <?php
 add_filter( 'plugins_list', function( $plugins ) {
     $first = array_key_first( $plugins['all'] );
     if ( $first ) {
         $plugins['my_plugins'][ $first ] = $plugins['all'][ $first ];
     }
     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:36>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list