[wp-hackers] Best practice for early access of post data

Claude Needham gxxaxx at gmail.com
Sun Sep 18 03:05:34 UTC 2011


On Sat, Sep 17, 2011 at 6:17 PM, Mike Schinkel
<mikeschinkel at newclarity.net> wrote:
> On Sep 17, 2011, at 8:54 PM, Claude Needham wrote:
>> Is there a proper way to get a peek at the data from the post(s)
>> without messing up the loop -- and who knows how many plugins and
>> filters?
>
> The 'posts_results' hook will show you the array of posts and the query object immediately after it runs the query.  Does that help?
>
> -Mike

Thanks for the suggestion. It put me on the right track.

However, after looking into it, I decided that 'the_posts' might be a
better filter.
'the_posts' is called after a fair bit of filtering.

But this gets me in the right ballpark. I just have to be careful
cause many different plugins and widgets also run through this code --
for example the recent posts widget.

Thanks again,
Claude


More information about the wp-hackers mailing list