Can an AJAX callback function access a PHP variable which was defined during initial page load?
Based on comments in this thread, I think using a WordPress transient to store the value of $myvar is the best solution in my case. One reason is because in my case, the browser does not need to know the value of the variable. Here is some more information to make an informed decision in … Read more