Problem
Three filters in wp-admin/includes/class-wp-posts-list-table.php document the $bulk parameter as @param bool but $bulk is actually an int (it's a loop counter: $bulk = 0; while ( $bulk < 2 )).
PHPStan reports a type mismatch on all three hooks.
Affected hooks
quick_edit_dropdown_authors_args at line 1758:
https://github.com/apermo/wordpress-develop/blob/trunk/src/wp-admin/includes/class-wp-posts-list-table.php#L1750-L1758
PHPDoc: @param bool $bulk A flag to denote if it's a bulk action.
Actual: $bulk is int (0 for quick edit, 1 for bulk edit)
quick_edit_dropdown_pages_args at line 1863:
https://github.com/apermo/wordpress-develop/blob/trunk/src/wp-admin/includes/class-wp-posts-list-table.php#L1855-L1863
PHPDoc: @param bool $bulk A flag to denote if it's a bulk action.
Actual: $bulk is int
quick_edit_statuses at line 2015:
https://github.com/apermo/wordpress-develop/blob/trunk/src/wp-admin/includes/class-wp-posts-list-table.php#L2007-L2015
PHPDoc: @param bool $bulk A flag to denote if it's a bulk action.
Actual: $bulk is int
Root cause
$bulk = 0;
while ( $bulk < 2 ) :
// ... $bulk is used as 0 (quick edit) or 1 (bulk edit) ...
$bulk++;
endwhile;
The variable is an integer loop counter, not a boolean flag.
Fix
Either:
- Change
@param bool $bulk to @param int $bulk in all three hooks, or
- Change the loop to use a
bool variable ($is_bulk_edit) and update the loop logic
Option 1 is the minimal fix. Option 2 is cleaner long-term.