[wp-hackers] something like a post_get_posts?
elrabino at gmail.com
Wed Sep 11 13:47:53 UTC 2013
Móvil: +54 (0261) 15-315-2244
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
> > main query is complete but before the template is rendered.
> > > loop_start seems like a good candidate but there's not much
> > > 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
> > between filtering the main query of a screen versus filtering all
> > 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
More information about the wp-hackers