Opened 11 years ago
Closed 9 years ago
#25406 closed enhancement (fixed)
XMLRPC wp_getPosts $filter argument should support more values
Reported by: | wordpressplugindeveloper | Owned by: | chriscct7 |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 3.8 |
Component: | XML-RPC | Keywords: | dev-feedback has-patch commit |
Focuses: | Cc: |
Description
Although "see get_posts() for more on $filter values" is written in the doc, it actually supports
'post_type', 'post_status', 'number', 'offset', 'orderby', and 'order' only, and there is one hidden value 's' that didn't mention in the doc.
Currently, the $filter argument is handled by function wp_getPosts like this:
$query = array(); if ( isset( $filter['offset'] ) ) $query['offset'] = absint( $filter['offset'] ); .... wp_get_recent_posts( $query );
I think it'd be better if you can use get_posts() instead and simply pass $filter as its argument.
just my 2 cents though.
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
That
@see
line that you quoted is meant as a modifier on the paragraph above:You're right that there's a doc bug that the
s
filter is missing both in code and in the Codex, that probably deserves a simple patch.With regards to the suggestion to pass through
$filter
towp_get_recent_posts
, I think the core devs had some reservations about that approach when we added this in 3.4. It would be nice to have more filter parameters for richer querying, but there might have been security/compatibility/performance concerns that made us not do this originally.