[wp-trac] [WordPress Trac] #42997: Add filter to WP_Comments_List_Table::prepare_items get_comments arguments

WordPress Trac noreply at wordpress.org
Fri Dec 29 10:03:52 UTC 2017


#42997: Add filter to WP_Comments_List_Table::prepare_items get_comments arguments
-------------------------+------------------------------
 Reporter:  soulseekah   |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Comments     |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:  administration
-------------------------+------------------------------
Changes (by birgire):

 * keywords:   => has-patch
 * component:  Administration => Comments


Comment:

 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
 [attachment: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 dockblock as for the sites list table.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42997#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list