Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function jeg_get_all_portfolio_category ($pageid) {
- $category = array();
- $query = new WP_Query(array(
- 'post_type' => 'portfolio',
- 'meta_query' => array(
- array(
- 'key' => 'portfolio_parent',
- 'value' => array($pageid),
- 'compare' => 'IN',
- )
- ),
- 'orderby' => 'menu_order',
- 'order' => 'ASC',
- 'nopaging' => true
- ));
- $result = $query->posts;
- foreach($result as $key => $value) {
- $termlist = get_the_terms($value->ID, JEG_PORTFOLIO_CATEGORY);
- if( !empty($termlist) ) {
- foreach($termlist as $termkey => $termvalue) {
- $category[$termkey] = $termvalue->name;
- }
- }
- }
- return $category;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement