Make WordPress Core

Changeset 56068

Timestamp:
06/27/2023 04:00:00 PM (14 months ago)
Author:
audrasjb
Message:

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.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-plugins-list-table.php

    r55954 r56068  
    296296            $plugins['search'] = array_filter( $plugins['all'], array( $this, '_search_callback' ) );
    297297        }
     298
     299
     300
     301
     302
     303
     304
     305
     306
    298307
    299308        $totals = array();
  • trunk/tests/phpunit/tests/admin/wpPluginsListTable.php

    r55903 r56068  
    2020
    2121    /**
    22      * Creates an admin user before any tests run.
     22     * The original value of the `$s` global.
     23     *
     24     * @var string|null
     25     */
     26    private static $original_s;
     27
     28    /**
     29     * @var array
     30     */
     31    public $fake_plugin = array(
     32        'fake-plugin.php' => array(
     33            'Name'        => 'Fake Plugin',
     34            'PluginURI'   => 'https://wordpress.org/',
     35            'Version'     => '1.0.0',
     36            'Description' => 'A fake plugin for testing.',
     37            'Author'      => 'WordPress',
     38            'AuthorURI'   => 'https://wordpress.org/',
     39            'TextDomain'  => 'fake-plugin',
     40            'DomainPath'  => '/languages',
     41            'Network'     => false,
     42            'Title'       => 'Fake Plugin',
     43            'AuthorName'  => 'WordPress',
     44        ),
     45    );
     46
     47    /**
     48     * Creates an admin user before any tests run and backs up the `$s` global.
    2349     */
    2450    public static function set_up_before_class() {
     51
     52
    2553        parent::set_up_before_class();
    2654
     
    3361            )
    3462        );
     63
    3564    }
    3665
     
    3867        parent::set_up();
    3968        $this->table = _get_list_table( 'WP_Plugins_List_Table', array( 'screen' => 'plugins' ) );
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
    4080    }
    4181
     
    254294        );
    255295    }
     296
     297
     298
     299
     300
     301
     302
     303
     304
     305
     306
     307
     308
     309
     310
     311
     312
     313
     314
     315
     316
     317
     318
     319
     320
     321
     322
     323
     324
     325
     326
     327
     328
     329
     330
     331
     332
     333
     334
     335
    256336}
Note: See TracChangeset for help on using the changeset viewer.