[wp-hackers] something like a post_get_posts?

Daniel Dvorkin elrabino at gmail.com
Wed Sep 11 13:47:53 UTC 2013


Filter the_posts?



---------------------
Daniel Dvorkin
Móvil: +54 (0261) 15-315-2244
Skype: mzaweb
http://mzaweb.com



On Tue, Sep 10, 2013 at 2:36 PM, Josh <joshua.sibelman at gmail.com> wrote:

> Great, thanks.
>
>
>
> On Tuesday, September 10, 2013 at 10:04 AM, Jeremy Clarke wrote:
>
> > On Fri, Sep 6, 2013 at 5:04 PM, Josh <joshua.sibelman at gmail.com (mailto:
> joshua.sibelman at gmail.com)> wrote:
> >
> > > There's no post_get_posts, but is there another action I can hook into
> > > that might be workable?
> > >
> >
> > I think the 'wp' action should offer what you need. IIRC it runs after
> the
> > main query is complete but before the template is rendered.
> >
> >
> > > loop_start seems like a good candidate but there's not much
> documentation
> > > about that one.
> > >
> >
> > In theory this would work but be very careful. 'loop_start' will fire on
> > every single loop, including secondary queries for widgets, related posts
> > etc.
> >
> > In either case you should be sure to check is_main_query() against your
> > WP_Query object before modifying it, or at least be aware of the
> difference
> > between filtering the main query of a screen versus filtering all
> possible
> > WP_Query instances.
> >
> > http://codex.wordpress.org/Function_Reference/is_main_query
> >
> > --
> > Jeremy Clarke • jeremyclarke.org (http://jeremyclarke.org)
> > Code and Design • globalvoicesonline.org (http://globalvoicesonline.org)
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com (mailto:wp-hackers at lists.automattic.com)
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> >
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list