Exemplo n.º 1
0
 public static function find($args = '')
 {
     $defaults = array('post_status' => 'any', 'posts_per_page' => -1, 'offset' => 0, 'orderby' => 'ID', 'order' => 'ASC');
     $args = wp_parse_args($args, $defaults);
     $args['post_type'] = self::post_type;
     $q = new WP_Query();
     $posts = $q->query($args);
     self::$found_items = $q->found_posts;
     $objs = array();
     foreach ((array) $posts as $post) {
         $objs[] = new self($post);
     }
     return $objs;
 }