Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function update_results(){
- // Nonce check.
- $nonce = $_REQUEST['nonce'];
- if ( ! wp_verify_nonce( $nonce, 'ajax_search_filters_nonce' ) ) {
- die( __('Busted.') ); // Nonce check
- }
- $args = array('post_type' => 'perf_task');
- $loop = new WP_Query( $args );
- ob_start();
- if ( ! $loop->have_posts() ) {
- }
- // render results
- while ( $loop->have_posts() ) {
- $loop->the_post();
- var_dump($post);
- //hsta_the_task_perf_card( $post );
- }
- wp_reset_postdata();
- $return = ob_get_contents();
- ob_end_clean();
- wp_send_json_success( $return );
- }
- add_action( 'wp_ajax_update_results', 'update_results' );
- add_action( 'wp_ajax_nopriv_update_results', 'update_results' );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement