| | |
| | | $query = new WP_Query($args); |
| | | $items = array_map([$this, 'formatItem'], $query->posts); |
| | | |
| | | $results = [ |
| | | 'items' => $items, |
| | | 'has_more' => $query->max_num_pages > $args['paged'], |
| | | 'total_items' => $query->found_posts, |
| | | 'total_pages' => $query->max_num_pages |
| | | ]; |
| | | return $results; |
| | | return [ |
| | | 'items' => $items, |
| | | 'has_more' => $query->max_num_pages > $args['paged'], |
| | | 'total_items' => $query->found_posts, |
| | | 'total_pages' => $query->max_num_pages |
| | | ]; |
| | | } |
| | | |
| | | /** |
| | |
| | | break; |
| | | } |
| | | if ($hierarchical && $key === 'term_name') { |
| | | $item[$key.'_path'] = JVB()->routes('term')->getTermPath($ID, $term->name, $term->taxonomy); |
| | | $item[$key.'_path'] = JVB()->routes('term')->getTermPath($ID, html_entity_decode($term->name), $term->taxonomy); |
| | | } |
| | | } |
| | | |