[wp-trac] [WordPress Trac] #59587: Pass column count to "after_plugin_row" action hooks in WP_Plugins_List_Table
WordPress Trac
noreply at wordpress.org
Tue Oct 10 21:17:08 UTC 2023
#59587: Pass column count to "after_plugin_row" action hooks in
WP_Plugins_List_Table
------------------------------------+---------------------
Reporter: TobiasBg | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.5
Component: Administration | Version:
Severity: normal | Resolution:
Keywords: has-patch dev-feedback | Focuses:
------------------------------------+---------------------
Comment (by TobiasBg):
Thanks for sticking with me, @afragen!
As these are `<tr>` rows of a table, their width is governed by the number
of cells (each row needs to have the same number of cells/colspans). This
has nothing to do with CSS.
I thought about your approach as well, but `_get_list_table(
'WP_Plugins_List_Table' )` will create a whole new instance of the
`WP_Plugins_List_Table` class, which doesn't really feel performant at
all.
In fact, it appears that your code only does this to retrieve that column
count, so it would benefit form the suggested addition as well (unless you
are using the `$wp_list_table` for something else later).
Also, creating a custom child class of WP_Plugins_List_Table for this and
using that instead of Core's class (on Core's Plugins screen -- not a
screen of a plugin!) won't be reasonable, for the introduced overhead.
(And this will actually fail as soon as more than one plugin does this.)
The suggested addition of the (already determined) column count as a
parameter to those action hooks will however greatly enhance and simplify
how they can be used.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59587#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list