linccce

Getter

May 11th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. abstract class Shopping_Wizard_Stash {
  2.  
  3.     public $query_data;
  4.  
  5.     function __construct() {
  6.         $loop = new WP_Query(
  7.             array(
  8.                 'post_type' => 'shopping_wizard',
  9.                 'orderby' => 'title',
  10.             )
  11.         );
  12.  
  13.         var_dump($loop);
  14.  
  15.         if($loop->have_posts()){
  16.             $output = (object) array();
  17.  
  18.             while($loop->have_posts()){
  19.                 $loop->the_post();
  20.                 $meta = get_post_meta(get_the_ID(), '');
  21.                 $output->append($meta);
  22.             }
  23.             $this->query_data = $output;
  24.         } else {
  25.             $this->query_data = false;
  26.         }
  27.     }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment