Opened 11 years ago
Closed 9 years ago
#24088 closed enhancement (wontfix)
Update get_users_drafts() to support custom post types
Reported by: | navjotjsingh | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.5.1 |
Component: | Users | Keywords: | has-patch |
Focuses: | Cc: |
Description
Currently get_users_drafts() access drafts of 'post' type only. Would be useful if it could support custom post types as well.
Attachments (3)
Change History (11)
#2
@
11 years ago
It seems very strange to me that this function only returns the ID
and post_title
fields instead of standard post objects.
The function isn't actually used anywhere in core, so perhaps we should leave it exactly as is but add a $post_type
parameter to the function.
#3
@
11 years ago
24088.patch adds support for custom post types and adds $user_id
to the get_users_draft
filter.
#4
@
11 years ago
- Keywords has-patch added
Just a couple nitpicks on 24088.patch, but the slash in @param string/array
should be a pipe character, |
, and $post_type
should also be marked 'Optional.'
Unrelated: Does it seem odd that the query string itself is filterable rather than the results here?
#5
@
11 years ago
I thought it was odd that the query arguments weren't filterable. I chalked it up to the function not being used anywhere in core.
I'd definitely like to make the arguments filterable though I'd worry about backwards compatibility with any plugins that are using the function.
#7
@
9 years ago
24088.3.patch is an updated patch for src/
+1 for sure, though I think the function should also be updated to use WP_Query in order to leverage existing APIs and take caching into account.