[wp-hackers] filter or action before loop?
lionel.pointet at globalis-ms.com
Mon Jun 18 13:49:56 UTC 2012
You could hook into "loop_start" and "loop_end" actions, which are launched:
* loop_start: the first time (and only the first time) "the_post()"
function is used on the query
* loop_end: the last time "have_posts()" function is used on the query
You get the WP_Query object associated with these actions.
This isn't a option taken by the majority of the other plugins because
you don't let the developper do what he wants with your API: if he wants
to create a widget that displays, without any loop, one part of your
data, he just can't...
As I write that, I can see you answered to yourself. Just keep in mind
that this will work only with one need, try to think of any needs!
Le 18/06/2012 15:44, Konrad Karpieszuk a écrit :
> hi there,
> is it possible to display something over main loop of posts using
> hooks? i don't want to ask users of my plugin to put my template tag.
> i want to make function which will check if loop starts and then show
> some html result
> (en) regards / (pl) pozdrawiam
> Konrad Karpieszuk
> http://tradematik.pl wtyczka do WordPressa do tworzenia sklepów dla
> klientów z Polski
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers