WordPress.org

Make WordPress Core

Opened 7 years ago

Last modified 3 years ago

#17020 new enhancement

Some comment queries are not filterable

Reported by: kevinB Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.1
Component: Comments Keywords: needs-refresh needs-unit-tests
Focuses: administration Cc:

Description

Although WP_Comment_Query::query() is fully filterable, some supplemental comment queries are still unfilterable. The submitted patch adds the following hooks:

  • function get_approved_comments() - query filter 'get_approved_comments_query'
  • function wp_dashboard_recent_comments() - query filter 'dashboard_recent_comments_query'

Attachments (3)

comment-filters_3.2.patch (1.9 KB) - added by kevinB 7 years ago.
query filters for wp_dashboard_recent_comments() and get_approved_comments()
get-approved-comments-3.2.diff (745 bytes) - added by adamsewell 7 years ago.
Modifies the get_approved_comments function to use get_comments
dashboard-recent-comments-3.2.diff (1.9 KB) - added by adamsewell 7 years ago.
Modifies the wp_dashboard_recent_comments function to use get_comments - updated to remove reference to $wpdb

Download all attachments as: .zip

Change History (12)

@kevinB
7 years ago

query filters for wp_dashboard_recent_comments() and get_approved_comments()

#1 @scribu
7 years ago

-1 on 'dashboard_recent_comments_query'. Just like in #17026, we should try to use get_comments(), instead of a direct query.

Don't know what to say about 'pending_comments_query'.

#2 @scribu
7 years ago

  • Keywords has-patch removed
  • Summary changed from add hooks for comment queries to Some comment queries are not filterable

#3 @adamsewell
7 years ago

  • Keywords has-patch added

#4 @adamsewell
7 years ago

  • Version set to 3.2

@adamsewell
7 years ago

Modifies the get_approved_comments function to use get_comments

@adamsewell
7 years ago

Modifies the wp_dashboard_recent_comments function to use get_comments - updated to remove reference to $wpdb

#5 @adamsewell
7 years ago

  • Cc adamsewell added

#6 @scribu
7 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Version changed from 3.2 to 3.1

#7 @chriscct7
4 years ago

  • Keywords needs-refresh added; has-patch removed

wp_dashboard_recent_comments was fixed in git-svn-id: http://core.svn.wordpress.org/trunk@26055 1a063a9b-81f0-0310-95a4-ce76da25c4cd (no trac ticket found for it). r26055 The other two still need to be fixed.

Last edited 3 years ago by markjaquith (previous) (diff)

#8 @boonebgorges
4 years ago

  • Keywords needs-unit-tests added

#9 @chriscct7
3 years ago

  • Focuses administration added
Note: See TracTickets for help on using tickets.