Esempio n. 1
0
  public function posts($args = array()) {
    
    // allows custom field based related terms to be included in queries
    
    global $wf, $meow_provider;
    
    if ($wf->regard_field_terms()) {

      $args = wp_parse_args($args);
      
      $qr = array();
      $qr["posts_per_page"] = $args["posts_per_page"];
      
      $args["posts_per_page"] = -1;
      
      $posts = parent::posts($args);

      $ids = $posts->extract("id");
      
      $incoming = $this->incoming($args);
      
      $incoming_ids = $incoming->extract("id");
      
      $r = wp_parse_args($args);
      
      $qr["post__in"] = array_merge($ids, $incoming_ids);
      
      WOOF::copy_args($r, $qr, "paged,offset,orderby,order");
      
      $posts = $wf->posts( $qr );

    } else {
      $posts = parent::posts($args);
    }
    
    return $posts;
    
  }