[wp-hackers] get_posts() alternative for all posts, published
lists.automattic.com at callum-macdonald.com
Mon Mar 5 04:59:47 GMT 2007
get_posts() is a template tag, thanks for the confirmation though, I'll
whip up an SQL query.
Robin Adrianse wrote:
> get_posts is, IIRC, a template tag, so it wouldn't have capabilities to
> fetch "hidden" (private, drafts, etc.) posts.
> I would recommend a direct SQL query.
> On 3/4/07, Callum Macdonald <lists.automattic.com at callum-macdonald.com>
>> I'm writing a plugin that updates a custom field on all posts in a given
>> category, both published and unpublished posts, with past or future
>> dates. I can't find a way to get the get_posts() function to retrieve
>> posts that don't currently appear on the blog. That makes sense given
>> that get_posts() is a template function.
>> I can't find an alternative function, nor can I figure out where
>> wp-admin/edit.php gets the list of posts. I figure it could be the wp()
>> function, but I can't find any documentation on the codex (probably on
>> account of how often the letters wp are used).
>> Can anyone suggest how to approach this?
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers