#42997 closed enhancement (fixed)
Add filter to WP_Comments_List_Table::prepare_items get_comments arguments
| Reported by: | soulseekah | Owned by: | rachelbaker |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.1 |
| Component: | Comments | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | administration |
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
@
9 years ago
- Component Administration → 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.
#4
@
8 years ago
- Milestone 5.0 → 5.0.1
- Resolution fixed
- Status closed → reopened
@since needs updating
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Concept