#15019 closed enhancement (fixed)
Filters / Actions for get_comments
Reported by: | sc0ttkclark | Owned by: | |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Plugins | Keywords: | has-patch |
Focuses: | Cc: |
Description
Currently in 3.1 (trunk) get_comments() has no filters or actions. I'd like to improve this by adding them following the same format as get_posts >> WP_Query::query uses. As you can see in my patch, it's very minimal, not too much going on here besides these main things:
- New action pre_get_comments to run similar to WP_Query::query pre_get_posts
- New filters / action for specific $post_where, $orderby, $oder, $limit (and some cache-enablers)
- New filter the_comments to modify what's returned in $comments similar to WP_Query::query the_posts
Attachments (4)
Change History (17)
#2
@
14 years ago
Just wanted to check in and see if there was anything further needed from me to get this into 3.1?
#3
@
14 years ago
Do we really need the 'comments_orderby_request' series?
More importantly, note that the trend in WP_Query is to pass all query statements at once: #14997
#4
@
14 years ago
That was a straight copy / paste from another section, any idea what I should use as an example of the WP_Query for passing all query statements at once for filtering?
#6
@
14 years ago
Must have been working with a previous revision ;) Will adjust all corresponding patches.
#7
@
14 years ago
Also, please try to make patches relative to the root WP folder. Currently, they are relative to wp-includes.
#9
@
14 years ago
- Keywords has-patch added
Refreshed and revised after IRC discussion with @scribu for best-practice methods.
@
14 years ago
Patch refreshed and revised with adjustments to the changes made by refresh - also fixed $post_where to be $where (for consistency) and resolved a bug with $author_email / $karma not adding a space before the AND in appending $where
#10
@
14 years ago
Attached new patch - Patch refreshed and revised with adjustments to the changes made by refresh - also fixed $post_where to be $where (for consistency) and resolved a bug with $author_email / $karma not adding a space before the AND in appending $where
Initial Patch including the new filters / actions