[wp-trac] [WordPress Trac] #58789: Not countable. row_actions @ /wp-admin/includes/class-wp-list-table.php
WordPress Trac
noreply at wordpress.org
Mon Dec 1 18:06:43 UTC 2025
#58789: Not countable. row_actions @ /wp-admin/includes/class-wp-list-table.php
----------------------------------------------------+----------------------
Reporter: Nate1 | Owner: (none)
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Administration | Version: 6.2
Severity: major | Resolution: wontfix
Keywords: has-patch has-unit-tests needs-testing | Focuses:
----------------------------------------------------+----------------------
Comment (by tyxla):
> A better solution may be to cast the return value of the
user_row_actions filter to an array.
We discussed this (working on the patch together during the WordCamp Sofia
contributor day), but just casting won't work; casting `false` to an
`array` will result in an array with a single `false` element:
{{{#!php
<?php
print_r((array)'false');
// Array
// (
// [0] => false
// )
}}}
Converting to an empty array seems like a good solution, but I'm still of
the same opinion: there are other places in core where we're not doing
this, and if we start doing it, it's too defensive, when documentation is
already in place about the argument types of those filters.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58789#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list