call_with_ajax = true; $json = $cq->the_leapin_posts(); // get thumbnail } elseif ($call_type == LEAPIN_Query_Params::$NAV_THUMBNAIL) { $cq = new LEAPIN_Query_Thumbnail(); $json = $cq->do_transaction(); // get posts in the tax } elseif ($call_type == LEAPIN_Query_Params::$NAV_TAXONOMY) { $cq = new LEAPIN_Query_Nav_Tax(); $json = $cq->do_transaction(); // get a post in nav } elseif ($call_type == LEAPIN_Query_Params::$NAV_SINGLE) { $cq = new LEAPIN_Query_Nav_Single(); $json = $cq->do_transaction(); } } else { // no call type error } echo apply_filters('leapin_ajax_call_json', $json, $_POST); die(); } add_action('wp_ajax_leapin_ajax_call', 'leapin_ajax_call'); add_action('wp_ajax_nopriv_leapin_ajax_call', 'leapin_ajax_call');