I'm using:
wp_localize_script( $handle, $namespace, $variables ); to declare some variables before the initial AJAX call is made, but I imagine I can't do the same thing again within a callback function? I need to declare a newly created ID for use in another function, what's the best way?
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
|
|||
|
|
|
The right way is to post the data back to the WordPress admin ajax url then in your PHP function access them using the Example jQuery function that passed a category id back to wordpress:
Then you can access the variables in WordPress by hooking into the
|
||||
|
|
|
What you could do is break down your functions and let the first function call return the newly created ID as a response. Then you could take the response and use |
|||
|
|