public static function getData($args) { $data = array(); //Check if have showcase options dont have posttype if ($args['posttype'] == 'none') { $terms = self::getTermByTaxonomy($args['category']); $info = array(); foreach ($terms as $term) { $query = self::byTermsQueryLimitOneTerm('attachment', $args['category'], $term); if ($query && $query->have_posts()) { while ($query->have_posts()) { $query->the_post(); $id = $query->post->ID; $info = self::getPostdataNoPosttype($args['category'], $id); if (!empty($info)) { $data[] = $info; } } } } //Showcase have any posttype } else { if ($args['posttype'] == 'team') { $data = self::get_post_data($args['posttype'], $args['category']); } else { $query = self::showcase_query($args['posttype'], $args['category']); if ($query && $query->have_posts()) { while ($query->have_posts()) { $query->the_post(); $id = $query->post->ID; //If postype is brochure if ($args['posttype'] == 'brochure') { $brochures = Brochure::getBrochuresByPost($id); foreach ($brochures as $brochure) { $info = Brochure::getInfo($brochure, $id); if (!empty($info)) { $data[] = $info; } } } else { $info = self::get_post_data($args['posttype'], $args['category'], $id); if (!empty($info)) { $data[] = $info; } } } } } } return $data; }
} } } } ?> <?php //Showcase have any posttype } else { $query = Showcase::showcase_query($args['posttype'], $args['category']); if ($query && $query->have_posts()) { while ($query->have_posts()) { $query->the_post(); $id = $query->post->ID; //If postype is brochure if ($args['posttype'] == 'brochure') { $brochures = Brochure::getBrochuresByPost($id); // echo"<pre>"; // print_r($brochures); // echo"</pre>"; foreach ($brochures as $brochure) { $info = Brochure::getInfo($brochure, $id); if (!empty($info)) { $data[] = $info; } } } else { $info = Showcase::get_post_data($args['posttype'], $args['category'], $id); if (!empty($info)) { $data[] = $info; } }