Opened 14 years ago
Closed 14 years ago
#17220 closed defect (bug) (fixed)
get_posts_by_author_sql() should use the post type object
Reported by: | nacin | Owned by: | |
---|---|---|---|
Milestone: | 3.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
The filter there, pub_priv_sql_capability, is pretty useless, particularly since it doesn't receive any context. Suggesting we simply remove it.
Patch also adds a $post_type property to count_many_users_posts().
Attachments (2)
Change History (7)
#2
@
14 years ago
- Keywords commit added
Tested with a custom column and using count_many_users_posts() with a custom post type.
#3
@
14 years ago
Alternative for keeping the filter should be this:
if ( ! $cap = apply_filters( 'pub_priv_sql_capability', '' ) ) $cap = $post_type_obj->cap->read_private_posts;
Rather than applying the filter over read_private_posts, given its historical usage.
#4
@
14 years ago
Either way, we should also remove the various comments about pub_priv_sql_capability() in the phpdoc for get_private_posts_cap_sql(), which is where the filter was introduced in r5189.
Note: See
TracTickets for help on using
tickets.
Untested.