{"action":"opened","issue":{"url":"https://api.github.com/repos/Mixd/wpst/issues/18","repository_url":"https://api.github.com/repos/Mixd/wpst","labels_url":"https://api.github.com/repos/Mixd/wpst/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/Mixd/wpst/issues/18/comments","events_url":"https://api.github.com/repos/Mixd/wpst/issues/18/events","html_url":"https://github.com/Mixd/wpst/issues/18","id":159922995,"number":18,"title":"Modification to wpst_get_pages","user":{"login":"DrizzlyOwl","id":3853061,"avatar_url":"https://avatars.githubusercontent.com/u/3853061?v=3","gravatar_id":"","url":"https://api.github.com/users/DrizzlyOwl","html_url":"https://github.com/DrizzlyOwl","followers_url":"https://api.github.com/users/DrizzlyOwl/followers","following_url":"https://api.github.com/users/DrizzlyOwl/following{/other_user}","gists_url":"https://api.github.com/users/DrizzlyOwl/gists{/gist_id}","starred_url":"https://api.github.com/users/DrizzlyOwl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DrizzlyOwl/subscriptions","organizations_url":"https://api.github.com/users/DrizzlyOwl/orgs","repos_url":"https://api.github.com/users/DrizzlyOwl/repos","events_url":"https://api.github.com/users/DrizzlyOwl/events{/privacy}","received_events_url":"https://api.github.com/users/DrizzlyOwl/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Mixd/wpst/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-13T10:53:16Z","updated_at":"2016-06-13T10:53:16Z","closed_at":null,"body":"The existing wpst_get_pages is a bit messy with undefined vars and unnecessary overwriting of vars. This function tidies it up\r\n\r\n```php\r\n/**\r\n * Get pages with specified options\r\n * \r\n * @param int $parent\r\n * @param int $count\r\n * @param string $orderby\r\n * @param string $order\r\n * @return WP_Query\r\n */\r\nfunction wpst_get_pages ( $parent = 0, $count = -1, $orderby = 'menu_order', $order = 'ASC' ) {\r\n\r\n    // Define arguments for query.\r\n    $args = [\r\n        'post_type'      => 'page',\r\n        'post_parent'    => $parent,\r\n        'posts_per_page' => $count,\r\n        'orderby'        => $orderby,\r\n        'order'          => $order\r\n    ];\r\n\r\n    // Return the results\r\n    return new WP_Query( $args );\r\n}\r\n```"}}
{"actor":{"display_login":"DrizzlyOwl"}}