Changeset 62491
- Timestamp:
- 06/11/2026 08:14:31 PM (2 weeks ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 2 edited
-
class-wp-list-table.php (modified) (16 diffs)
-
class-wp-plugins-list-table.php (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-list-table.php
r62400 r62491 20 20 * 21 21 * @since 3.1.0 22 * @var array 22 * 23 * @var array<int|string, mixed> 23 24 */ 24 25 public $items; … … 28 29 * 29 30 * @since 3.1.0 30 * @var array 31 * 32 * @var array<string, mixed> 31 33 */ 32 34 protected $_args; … … 36 38 * 37 39 * @since 3.1.0 38 * @var array 40 * 41 * @var array<string, mixed> 39 42 */ 40 43 protected $_pagination_args = array(); … … 44 47 * 45 48 * @since 3.1.0 49 * 46 50 * @var WP_Screen 47 51 */ … … 52 56 * 53 57 * @since 3.1.0 54 * @var array 58 * 59 * @var array<string, string|array<string, string>>|null 55 60 */ 56 61 private $_actions; … … 60 65 * 61 66 * @since 3.1.0 67 * 62 68 * @var string 63 69 */ … … 68 74 * 69 75 * @since 4.1.0 70 * @var array 76 * 77 * @var array<string, string> 71 78 */ 72 79 protected $modes = array(); 73 80 74 81 /** 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 79 87 */ 80 88 protected $_column_headers; … … 83 91 * List of private properties made readable for backward compatibility. 84 92 * 85 * @var array 93 * @since 4.2.0 94 * 95 * @var string[] 86 96 */ 87 97 protected $compat_fields = array( '_args', '_pagination_args', 'screen', '_actions', '_pagination' ); … … 90 100 * List of private/protected methods made readable for backward compatibility. 91 101 * 92 * @var array 102 * @since 4.2.0 103 * 104 * @var string[] 93 105 */ 94 106 protected $compat_methods = array( … … 117 129 * the default $args. 118 130 * 119 * @since 3. 1.0131 * @since 3.2.0 120 132 * 121 133 * @param array|string $args { … … 349 361 350 362 /** 351 * Determines whether the table has items to display or not 363 * Determines whether the table has items to display or not. 352 364 * 353 365 * @since 3.1.0 … … 360 372 361 373 /** 362 * Message to be displayed when there are no items 374 * Message to be displayed when there are no items. 363 375 * 364 376 * @since 3.1.0 … … 791 803 * @since 3.1.0 792 804 * 793 * @param string $current_mode 805 * @param string $current_mode The current view mode slug, e.g. 'list' or 'excerpt'. 794 806 */ 795 807 protected function view_switcher( $current_mode ) { … … 1390 1402 * @since 3.1.0 1391 1403 * 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. 1393 1405 */ 1394 1406 public function print_column_headers( $with_id = true ) { … … 1658 1670 1659 1671 /** 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 * 1663 1676 * @param string $which The location of the navigation: Either 'top' or 'bottom'. 1664 1677 */ … … 1737 1750 1738 1751 /** 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. 1741 1758 */ 1742 1759 protected function column_default( $item, $column_name ) {} 1743 1760 1744 1761 /** 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. 1746 1767 */ 1747 1768 protected function column_cb( $item ) {} -
trunk/src/wp-admin/includes/class-wp-plugins-list-table.php
r61695 r62491 28 28 * Constructor. 29 29 * 30 * @since 3. 1.030 * @since 3.2.0 31 31 * 32 32 * @see WP_List_Table::__construct() for more information on default arguments. … … 64 64 65 65 /** 66 * @return array 66 * Gets the CSS classes for the list table element. 67 * 68 * @since 3.1.0 69 * 70 * @return string[] Array of CSS classes for the table tag. 67 71 */ 68 72 protected function get_table_classes() { … … 71 75 72 76 /** 73 * @return bool 77 * Checks whether the current user can activate plugins for this screen. 78 * 79 * @since 3.1.0 80 * 81 * @return bool Whether the current user can activate plugins. 74 82 */ 75 83 public function ajax_user_can() { … … 78 86 79 87 /** 80 * @global string $status 81 * @global array $plugins 82 * @global array $totals 83 * @global int $page 84 * @global string $orderby 85 * @global string $order 86 * @global string $s 88 * Prepares the list of items for displaying. 89 * 90 * @since 3.1.0 91 * 92 * @global string $status Current plugin status filter slug. 93 * @global array<string, array<string, array<string, mixed>>> $plugins Array of plugin data arrays grouped by status. 94 * @global array<string, int> $totals Count of plugins for each status group. 95 * @global int $page Current page number. 96 * @global string $orderby Column name to sort by. 97 * @global string $order Sort direction, 'ASC' or 'DESC'. 98 * @global string $s URL-encoded search term. 87 99 */ 88 100 public function prepare_items() { … … 365 377 366 378 /** 379 * Callback to filter plugins by a search term. 380 * 381 * @since 3.1.0 382 * 367 383 * @global string $s URL encoded search term. 368 384 * 369 * @param array $plugin370 * @return bool 385 * @param array<string, mixed> $plugin Plugin data array to check against the search term. 386 * @return bool True if the plugin matches the search term, false otherwise. 371 387 */ 372 388 public function _search_callback( $plugin ) { … … 383 399 384 400 /** 385 * @global string $orderby 386 * @global string $order 387 * @param array $plugin_a 388 * @param array $plugin_b 389 * @return int 401 * Callback to sort plugins by a given column. 402 * 403 * @since 3.1.0 404 * 405 * @global string $orderby The column name to sort by. 406 * @global string $order The sort direction ('ASC' or 'DESC'). 407 * 408 * @param array<string, mixed> $plugin_a First plugin data array to compare. 409 * @param array<string, mixed> $plugin_b Second plugin data array to compare. 410 * @return int Negative if $plugin_a sorts before $plugin_b, positive if after, 0 if equal. 390 411 */ 391 412 public function _order_callback( $plugin_a, $plugin_b ) { … … 407 428 408 429 /** 409 * @global array $plugins 430 * Message to be displayed when there are no items. 431 * 432 * @since 3.1.0 433 * 434 * @global array<string, array<string, array<string, mixed>>> $plugins Array of plugin data arrays grouped by status. 410 435 */ 411 436 public function no_items() { … … 460 485 461 486 /** 462 * @global string $status 463 * 464 * @return string[] Array of column titles keyed by their column name. 487 * Gets the list of columns for this list table. 488 * 489 * @since 3.1.0 490 * 491 * @global string $status Current plugin status filter slug. 492 * 493 * @return array<string, string> An associative array of column titles keyed by their column name. 465 494 */ 466 495 public function get_columns() { … … 481 510 482 511 /** 483 * @return array 512 * Gets the list of sortable columns for this list table. 513 * 514 * @since 3.1.0 515 * 516 * @return array<string, array<int, string|bool>|string> An associative array of sortable columns. 484 517 */ 485 518 protected function get_sortable_columns() { … … 488 521 489 522 /** 490 * @global array $totals 491 * @global string $status 492 * @return array 523 * Gets an associative array of status filter links for the views area. 524 * 525 * @since 3.1.0 526 * 527 * @global array<string, int> $totals Count of plugins for each status group. 528 * @global string $status Current plugin status filter slug. 529 * 530 * @return array<string, string> An associative array of views. 493 531 */ 494 532 protected function get_views() { … … 617 655 618 656 /** 619 * @global string $status 620 * @return array 657 * Gets the available bulk actions for the plugins list table. 658 * 659 * @since 3.1.0 660 * 661 * @global string $status Current plugin status filter slug. 662 * 663 * @return array<string, string> An associative array of bulk actions. 621 664 */ 622 665 protected function get_bulk_actions() { … … 656 699 657 700 /** 658 * @global string $status 659 * @param string $which 701 * Displays the bulk actions dropdown. 702 * 703 * @since 3.1.0 704 * 705 * @global string $status Current plugin status filter slug. 706 * 707 * @param string $which The location of the bulk actions: Either 'top' or 'bottom'. 708 * This is designated as optional for backward compatibility. 660 709 */ 661 710 public function bulk_actions( $which = '' ) { … … 670 719 671 720 /** 672 * @global string $status 673 * @param string $which 721 * Displays extra table navigation for the plugins list table. 722 * 723 * @since 3.1.0 724 * 725 * @global string $status Current plugin status filter slug. 726 * 727 * @param string $which The location: 'top' or 'bottom'. 674 728 */ 675 729 protected function extra_tablenav( $which ) { … … 701 755 702 756 /** 703 * @return string 757 * Gets the current action selected from the bulk actions dropdown. 758 * 759 * Also handles the 'clear-recent-list' action from the Recently Active plugins screen. 760 * 761 * @since 3.1.0 762 * 763 * @return string|false The action name. False if no action was selected. 704 764 */ 705 765 public function current_action() { … … 716 776 * @since 3.1.0 717 777 * 718 * @global string $status 778 * @global string $status Current plugin status filter slug. 719 779 */ 720 780 public function display_rows() { … … 731 791 732 792 /** 733 * @global string $status 734 * @global int $page 735 * @global string $s 736 * @global array $totals 737 * 738 * @param array $item 793 * Generates the markup for a single plugin row. 794 * 795 * @since 3.1.0 796 * 797 * @global string $status Current plugin status filter slug. 798 * @global int $page Current page number. 799 * @global string $s URL-encoded search term. 800 * @global array<string, int> $totals Count of plugins for each status group. 801 * 802 * @param array $item The current item. An array containing the plugin file path and plugin data. 803 * @phpstan-param array{string, array<string, mixed>} $item 739 804 */ 740 805 public function single_row( $item ) {
Note: See TracChangeset
for help on using the changeset viewer.