[wp-hackers] $wp_query Disappears after AJAX
spencer.gurnk at gmail.com
Thu Apr 1 19:08:59 UTC 2010
Okay I had that idea and thought about posting the original $query_string so
I could retrieve it through my function. Then is there a way I can covert my
array of arguments to a query string to match the other format?
On Thu, Apr 1, 2010 at 3:07 PM, Vinicius Massuchetto <
viniciusandre at gmail.com> wrote:
> On Thu, Apr 1, 2010 at 3:54 PM, Spencer <spencer.gurnk at gmail.com> wrote:
> > Hey everyone,
> > I'm not sure if this is a bug, or I'm doing something completely wrong,
> > I'm in a bit of a pickle.
> > I'm trying to merge an array of arguments (that I created) with the
> > $wp_query->query array. It's fine the first time it loads (just calling
> > function directly), but then once it gets updated with AJAX (the same
> > function is called through add_action( 'wp_ajax_callback', 'callback'
> > the $wp_query variable seems to disappear. Any ideas why that would make
> > mess up?
> > I've tried everything I can think of. I've tried making temporary
> > of $wp_query and restoring it, wp_reset_query, and a million combinations
> > other things.
> Calling an AJAX request implies of having another timeline on page
> loading, like loading another page. AFAIK, it only posts something
> again to a webpage, needing new queries and stuff to be loaded if you
> need them.
> You can assign $_SESSION variables, or use the $_POST variables to
> load some info again if you need something pre-loaded for this AJAX
> Hope it helps.
> Vinicius Massuchetto
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers