{"action":"opened","issue":{"url":"https://api.github.com/repos/bigspring/monolith/issues/296","labels_url":"https://api.github.com/repos/bigspring/monolith/issues/296/labels{/name}","comments_url":"https://api.github.com/repos/bigspring/monolith/issues/296/comments","events_url":"https://api.github.com/repos/bigspring/monolith/issues/296/events","html_url":"https://github.com/bigspring/monolith/issues/296","id":62442063,"number":296,"title":"Top Level Check","user":{"login":"dmseaton","id":8384343,"avatar_url":"https://avatars.githubusercontent.com/u/8384343?v=3","gravatar_id":"","url":"https://api.github.com/users/dmseaton","html_url":"https://github.com/dmseaton","followers_url":"https://api.github.com/users/dmseaton/followers","following_url":"https://api.github.com/users/dmseaton/following{/other_user}","gists_url":"https://api.github.com/users/dmseaton/gists{/gist_id}","starred_url":"https://api.github.com/users/dmseaton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmseaton/subscriptions","organizations_url":"https://api.github.com/users/dmseaton/orgs","repos_url":"https://api.github.com/users/dmseaton/repos","events_url":"https://api.github.com/users/dmseaton/events{/privacy}","received_events_url":"https://api.github.com/users/dmseaton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bigspring/monolith/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/bigspring/monolith/labels/needs%20review","name":"needs review","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-17T16:10:49Z","updated_at":"2015-03-17T16:10:49Z","closed_at":null,"body":"Wrote this unnecessarily today but seems like it could be useful at some point. Worth including?\r\n\r\n```\r\nif (!function_exists('is_top_level')) {\r\n\r\n    /**\r\n     * Return true if the passed page ID has no parent\r\n     * \r\n     * @param $id\r\n     * @return bool\r\n     */\r\n    function is_top_level($id)\r\n    {\r\n        $ancestors = array_filter(get_post_ancestors($id));\r\n        return empty($ancestors);\r\n    }\r\n}\r\n```"}}