Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected function set_posts_query($query = false) {
- global $json_api, $wp_query;
- if (!$query) {
- $query = array();
- }
- $query = array_merge($query, $wp_query->query);
- if ($json_api->query->page) {
- $query['paged'] = $json_api->query->page;
- }
- if ($json_api->query->count) {
- $query['posts_per_page'] = $json_api->query->count;
- }
- if ($json_api->query->showposts) {
- $query['showposts'] = $json_api->query->showposts;
- }
- if ($json_api->query->post_type) {
- $query['post_type'] = $json_api->query->post_type;
- }
- if (!empty($query)) {
- wp_reset_query();
- query_posts($query);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement