Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2015
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. function update_results(){
  2.     // Nonce check.
  3.     $nonce = $_REQUEST['nonce'];
  4.     if ( ! wp_verify_nonce( $nonce, 'ajax_search_filters_nonce' ) ) {
  5.         die( __('Busted.') ); // Nonce check
  6.     }
  7.  
  8.     $args = array('post_type' => 'perf_task');
  9.     $loop = new WP_Query( $args );
  10.  
  11.     ob_start();
  12.     if ( ! $loop->have_posts() ) {
  13.  
  14.     }
  15.  
  16.     // render results
  17.     while ( $loop->have_posts() ) {
  18.        
  19.     $loop->the_post();
  20.     var_dump($post);
  21.         //hsta_the_task_perf_card( $post );
  22. }
  23.     wp_reset_postdata();
  24.  
  25.     $return = ob_get_contents();
  26.     ob_end_clean();
  27.  
  28.     wp_send_json_success( $return );
  29. }
  30. add_action( 'wp_ajax_update_results', 'update_results' );
  31. add_action( 'wp_ajax_nopriv_update_results', 'update_results' );
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement