[wp-hackers] Making use of The Loop in a shortcode function

Brian Layman bulk at thecodecave.com
Tue Jun 22 18:54:59 UTC 2010


That's pretty much it for PHP5, AFAIK.

In php4 you'd just assign it.  

A code sample from a legacy theme:
$temp = $wp_query; 
$wp_query = null;
$wp_query = new WP_Query();
[..]
$wp_query = null;
$wp_query = $temp;

The old school object shuffle.

I've never thought of using it in a shortcode though... nifty.
______________________________________________
Brian Layman
eHermits, Inc.
TheCodeCave.com / RhettandLink.com / twitter.com/BrianLayman /
facebook.com/eHermit





More information about the wp-hackers mailing list