Plugins: Introduce the plugins_list filter.

This changeset adds the `plugins_list` hook, which can be use to filter the list of plugin displayed on WP Admin Plugins screen.

Props nateallen, fischfood, mukesh27, peterwilsoncc, SergeyBiryukov, audrasjb, costdev, ecorica, zunaid321.
Fixes #57278.



Built from https://develop.svn.wordpress.org/trunk@56068


git-svn-id: http://core.svn.wordpress.org/trunk@55580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2023-06-27 16:01:27 +00:00
parent b459be6a15
commit c11e87fbb8
2 changed files with 10 additions and 1 deletions

View File

@ -296,6 +296,15 @@ class WP_Plugins_List_Table extends WP_List_Table {
$plugins['search'] = array_filter( $plugins['all'], array( $this, '_search_callback' ) );
}
/**
* Filters the array of plugins for the list table.
*
* @since 6.3.0
*
* @param array[] $plugins An array of arrays of plugin data, keyed by context.
*/
$plugins = apply_filters( 'plugins_list', $plugins );
$totals = array();
foreach ( $plugins as $type => $list ) {
$totals[ $type ] = count( $list );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.3-alpha-56067';
$wp_version = '6.3-alpha-56068';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.