[wp-trac] [WordPress Trac] #21344: Add hook "restrict_manage_comments" to class-wp-comments-list-table.php for additional filtering by plugins
WordPress Trac
wp-trac at lists.automattic.com
Sun Jul 22 19:20:25 UTC 2012
#21344: Add hook "restrict_manage_comments" to class-wp-comments-list-table.php for
additional filtering by plugins
-------------------------+--------------------
Reporter: hardy101 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 3.5
Component: Comments | Version: 3.4.1
Severity: normal | Resolution:
Keywords: has-patch |
-------------------------+--------------------
Comment (by hardy101):
The problem with adding the proposed hook to prepare_items() is that we
actually need to be able to output a form element on edit-comments.php
just prior to the "Filter" button. (e.g. add a select list that lets us
filter by user_id).
class-wp-comments-list-table.php does it's own form element via
extra_tablenav(), where our hook would also live.
The way it works now, to build edit-comments.php's page:
{{{
display()
}}}
calls
{{{
display_tablenav()
}}}
and class-wp-comments-list-table.php overrides
{{{
extra_tablenav()
}}}
to add a "comment_type" select list, then
{{{
display()
}}}
continues to build the rest of the rows in the edit-comments.php table.
Our simple hook (see attached "comments-table-hook-patch.diff") would
allow us to place our own form element(s) prior to the filter button for a
clean look. The "manage_comments_nav" filter is too late and would put
our new form elements after the Filter button, which makes for an odd UX.
So after some additional thought, I still vote for putting the hook in
class-wp-comments-list-table.php -> extra_tablenav() like the posts list
currently does.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21344#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list