So I have this code snippet.
function get_box_ajax() {
global $box;
$box = get_box(); // creates box object
ob_start();
get_template( '/filepath/content.php' );
$output = ob_get_clean();
}
// in the content.php file
global $box;
<form action="<?php echo box_url( $box->url ); ?>" method="post"> // error on this line
...
</form>
So with this code, I am getting a non-object error on the call to $box->url. Take note this is done via ajax.
So I thought in my ajax function I have already globalized $box and that will take but it doesn't seem to work? Any thoughts?