Example #1
0
 public function oldest_post($post_type)
 {
     if (!$this->count) {
         return;
     }
     $Post = get_post_controllers(array('post_type' => $post_type, 'numberposts' => 1, 'orderby' => 'date', 'order' => 'ASC', 'tax_query' => array(array('taxonomy' => $this->taxonomy, 'terms' => $this->term_id))));
     if (!empty($Post)) {
         return $Post[0];
     }
 }
Example #2
0
 private function controllers($values)
 {
     if (is_array($values)) {
         if (!empty($values)) {
             return get_post_controllers($values);
         } else {
             return array();
         }
     } else {
         return $values;
     }
 }