[wp-trac] [WordPress Trac] #22208: get_children() doesn't support 'fields' => 'ids' as an argument
WordPress Trac
noreply at wordpress.org
Sat Nov 23 07:39:00 UTC 2013
#22208: get_children() doesn't support 'fields' => 'ids' as an argument
------------------------------+-----------------------------
Reporter: danielbachhuber | Owner: wonderboymusic
Type: enhancement | Status: closed
Priority: normal | Milestone: 3.7
Component: Query | Version: 3.4.2
Severity: normal | Resolution: fixed
Keywords: has-patch commit |
------------------------------+-----------------------------
Comment (by jorgeorpinel):
I believe I found a small bug with the workaround currently in use for
this enhancement.
[http://codex.wordpress.org/Function_Reference/get_children get_children]
"works similar to get_posts" (quoted from that codex page), but NOT
EXACTLY the same.
It seems that certain parameters of the WP_Query are different by default
in get_posts, such as 'nopaging' => 'false' (in get_posts) and
'post_status' => 'any' in get_children. Additionally, the format in which
each function returns the values is different, where get_post's array is
indexed by 0..n and get_children's by the post IDs.
I think It'd be nice to make the fields parameter work in get_children
without overriding its calls with get_posts. Otherwise at least, the
default WP_Query parameters in the overriding get_posts could be made to
match the get_children defaults.
Thanks!
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22208#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list