[wp-trac] [WordPress Trac] #12821: Merge get_posts() and get_pages()
WordPress Trac
wp-trac at lists.automattic.com
Mon Mar 7 05:37:56 UTC 2011
#12821: Merge get_posts() and get_pages()
-------------------------------------+-----------------------------
Reporter: mikeschinkel | Owner: garyc40
Type: enhancement | Status: assigned
Priority: normal | Milestone: Future Release
Component: Post Types | Version: 3.0
Severity: normal | Resolution:
Keywords: has-patch needs-testing |
-------------------------------------+-----------------------------
Comment (by garyc40):
Replying to [comment:32 scribu]:
> Ok, but 'child_of' and 'depth' will actually be handled in WP_Query, no?
So it's redundant to set them as defaults in get_posts().
Actually `depth` is an argument for `wp_dropdown_pages()`, so I'm removing
it from `get_posts()` in an upcoming patch.
But there are other arguments such as `offset`, `meta_key`, `meta_value`
etc. which are being set as defaults in `get_posts()` but are also checked
and handled in WP_Query. Putting `child_of` as a default there does no
harm and simply makes it more obvious which arguments and default values a
WP developer can use with `get_posts()`. That being said, I don't really
mind if it's considered redundant and gets removed.
I'm more concerned with whether there's any wrong assumption I made when
merging the two functions. I tested the patch and it seems like it returns
the correct results. But there might be edge cases of `get_pages()` that I
don't know about, let alone performance issues.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12821#comment:33>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list