#42997 closed enhancement (fixed)
Add filter to WP_Comments_List_Table::prepare_items get_comments arguments
Reported by: | soulseekah | Owned by: | rachelbaker |
---|---|---|---|
Milestone: | 5.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Comments | Keywords: | has-patch |
Focuses: | administration | Cc: |
Description
Filtering the comments in the backend is quite hacky right now if not impossible.
This is a proposal to add a simple filter the $args
parameter to the get_comments
calls inside WP_Comments_List_Table::prepare_items
.
Attachments (3)
Change History (13)
#1
@
7 years ago
- Component changed from Administration to Comments
- Keywords has-patch added
Hi @soulseekah
This seems to be in line with other table query argument filters.
For example within the users list table:
/** * Filters the query arguments used to retrieve users for the current users list table. * * @since 4.4.0 * * @param array $args Arguments passed to WP_User_Query to retrieve items for the current * users list table. */ $args = apply_filters( 'users_list_table_query_args', $args );
and within the sites list table:
/** * Filters the arguments for the site query in the sites list table. * * @since 4.6.0 * * @param array $args An array of get_sites() arguments. */ $args = apply_filters( 'ms_sites_list_table_query_args', $args );
For the comments list table, I would suggest adjusting 42997.diff according to the same filter naming convention:
/** * Filters the arguments for the comment query in the comments list table. * * @since trunk * * @param array $args An array of get_comments() arguments. */ $args = apply_filters( 'comments_list_table_query_args', $args );
with similar adjustments to the docblock as for the sites list table.
#3
@
7 years ago
- Owner set to rachelbaker
- Resolution set to fixed
- Status changed from new to closed
In 42420:
#4
@
6 years ago
- Milestone changed from 5.0 to 5.0.1
- Resolution fixed deleted
- Status changed from closed to reopened
@since
needs updating
Note: See
TracTickets for help on using
tickets.
Concept