Make WordPress Core


Ignore:
Timestamp:
06/11/2026 08:14:31 PM (3 months ago)
Author:
westonruter
Message:

Docs: Improve WP_List_Table and WP_Plugins_List_Table docblocks.

Improve the PHPDoc docblocks in WP_List_Table and WP_Plugins_List_Table for accuracy, completeness, and consistency with WordPress core documentation standards. Adds missing @since tags and corrects several existing versions, adds summary descriptions to all previously bare method and property docblocks, and refines type annotations with precise generic array types.

Developed in https://github.com/WordPress/wordpress-develop/pull/10989.
Follow-up to r30679, r31127, r32642, r32654.

Props huzaifaalmesbah, westonruter, noruzzaman.
See #64896.

File:
1 edited

Legend:

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

    r62400 r62491  
    2020         *
    2121         * @since 3.1.0
    22          * @var array
     22         *
     23         * @var array<int|string, mixed>
    2324         */
    2425        public $items;
     
    2829         *
    2930         * @since 3.1.0
    30          * @var array
     31         *
     32         * @var array<string, mixed>
    3133         */
    3234        protected $_args;
     
    3638         *
    3739         * @since 3.1.0
    38          * @var array
     40         *
     41         * @var array<string, mixed>
    3942         */
    4043        protected $_pagination_args = array();
     
    4447         *
    4548         * @since 3.1.0
     49         *
    4650         * @var WP_Screen
    4751         */
     
    5256         *
    5357         * @since 3.1.0
    54          * @var array
     58         *
     59         * @var array<string, string|array<string, string>>|null
    5560         */
    5661        private $_actions;
     
    6065         *
    6166         * @since 3.1.0
     67         *
    6268         * @var string
    6369         */
     
    6874         *
    6975         * @since 4.1.0
    70          * @var array
     76         *
     77         * @var array<string, string>
    7178         */
    7279        protected $modes = array();
    7380
    7481        /**
    75          * Stores the value returned by ::get_column_info().
    76          *
    77          * @since 4.1.0
    78          * @var array|null
     82         * Stores the value returned by {@see self::get_column_info()}.
     83         *
     84         * @since 4.2.0
     85         *
     86         * @var array<int, array|string>|null
    7987         */
    8088        protected $_column_headers;
     
    8391         * List of private properties made readable for backward compatibility.
    8492         *
    85          * @var array
     93         * @since 4.2.0
     94         *
     95         * @var string[]
    8696         */
    8797        protected $compat_fields = array( '_args', '_pagination_args', 'screen', '_actions', '_pagination' );
     
    90100         * List of private/protected methods made readable for backward compatibility.
    91101         *
    92          * @var array
     102         * @since 4.2.0
     103         *
     104         * @var string[]
    93105         */
    94106        protected $compat_methods = array(
     
    117129         * the default $args.
    118130         *
    119          * @since 3.1.0
     131         * @since 3.2.0
    120132         *
    121133         * @param array|string $args {
     
    349361
    350362        /**
    351          * Determines whether the table has items to display or not
     363         * Determines whether the table has items to display or not.
    352364         *
    353365         * @since 3.1.0
     
    360372
    361373        /**
    362          * Message to be displayed when there are no items
     374         * Message to be displayed when there are no items.
    363375         *
    364376         * @since 3.1.0
     
    791803         * @since 3.1.0
    792804         *
    793          * @param string $current_mode
     805         * @param string $current_mode The current view mode slug, e.g. 'list' or 'excerpt'.
    794806         */
    795807        protected function view_switcher( $current_mode ) {
     
    13901402         * @since 3.1.0
    13911403         *
    1392          * @param bool $with_id Whether to set the ID attribute or not
     1404         * @param bool $with_id Whether to set the ID attribute or not. Default true.
    13931405         */
    13941406        public function print_column_headers( $with_id = true ) {
     
    16581670
    16591671        /**
    1660          * Generates the table navigation above or below the table
    1661          *
    1662          * @since 3.1.0
     1672         * Generates the table navigation above or below the table.
     1673         *
     1674         * @since 3.1.0
     1675         *
    16631676         * @param string $which The location of the navigation: Either 'top' or 'bottom'.
    16641677         */
     
    17371750
    17381751        /**
    1739          * @param object|array $item
    1740          * @param string $column_name
     1752         * Handles an unknown column.
     1753         *
     1754         * @since 4.2.0
     1755         *
     1756         * @param object|array $item        The current item.
     1757         * @param string       $column_name Name of the column.
    17411758         */
    17421759        protected function column_default( $item, $column_name ) {}
    17431760
    17441761        /**
    1745          * @param object|array $item
     1762         * Handles the checkbox column output.
     1763         *
     1764         * @since 4.2.0
     1765         *
     1766         * @param object|array $item The current item.
    17461767         */
    17471768        protected function column_cb( $item ) {}
Note: See TracChangeset for help on using the changeset viewer.