{"action":"created","comment":{"url":"https://api.github.com/repos/alleyinteractive/apple-news/pulls/comments/98474448","pull_request_review_id":19109626,"id":98474448,"diff_hunk":"@@ -107,18 +125,55 @@ public function page_themes_render() {\n \t}\n \n \t/**\n+\t * Theme preview page render.\n+\t *\n+\t * @access public\n+\t */\n+\tpublic function page_theme_preview_render() {\n+\t\tif ( ! current_user_can( apply_filters( 'apple_news_settings_capability', 'manage_options' ) ) ) {\n+\t\t\twp_die( __( 'You do not have permissions to access this page.', 'apple-news' ) );\n+\t\t}\n+\n+\t\t$error = '';\n+\t\t// Check for a valid theme\n+\t\tif ( ! isset( $_GET['theme'] ) ) {\n+\t\t\t$error = __( 'No theme was specified to preview', 'apple-news' );\n+\t\t} else {\n+\t\t\t$theme_name = sanitize_text_field( $_GET['theme'] );\n+\n+\t\t\t// Load the theme\n+\t\t\t$theme = get_option( $this->theme_key_from_name( $theme_name ) );\n+\t\t\tif ( empty( $theme ) || ! is_array( $theme ) ) {\n+\t\t\t\t$error = sprintf(\n+\t\t\t\t\t__( 'The theme %s does not exist', 'apple-news' ),\n+\t\t\t\t\t$theme_name\n+\t\t\t\t);\n+\t\t\t}\n+\t\t}\n+\n+\t\t// Set the URL for the back button\n+\t\t$theme_admin_url = $this->theme_admin_url();\n+\n+\t\t// Load the preview page\n+\t\tinclude plugin_dir_path( __FILE__ ) . 'partials/page_theme_preview.php';\n+\t}\n+\n+\t/**\n \t * Register assets for the options page.\n \t *\n \t * @param string $hook\n \t * @access public\n \t */\n \tpublic function register_assets( $hook ) {\n-\t\tif ( 'apple-news_page_apple-news-themes' != $hook ) {\n+\t\tif ( ! in_array( $hook, array(\n+\t\t\t'apple-news_page_apple-news-themes',\n+\t\t\t'apple-news_page_apple-news-theme-preview'","path":"admin/class-admin-apple-themes.php","position":129,"original_position":129,"commit_id":"6678c0effc8fa803b108f7318b641bee19a609e0","original_commit_id":"6678c0effc8fa803b108f7318b641bee19a609e0","user":{"login":"romancandlethoughts","id":1018205,"avatar_url":"https://avatars.githubusercontent.com/u/1018205?v=3","gravatar_id":"","url":"https://api.github.com/users/romancandlethoughts","html_url":"https://github.com/romancandlethoughts","followers_url":"https://api.github.com/users/romancandlethoughts/followers","following_url":"https://api.github.com/users/romancandlethoughts/following{/other_user}","gists_url":"https://api.github.com/users/romancandlethoughts/gists{/gist_id}","starred_url":"https://api.github.com/users/romancandlethoughts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romancandlethoughts/subscriptions","organizations_url":"https://api.github.com/users/romancandlethoughts/orgs","repos_url":"https://api.github.com/users/romancandlethoughts/repos","events_url":"https://api.github.com/users/romancandlethoughts/events{/privacy}","received_events_url":"https://api.github.com/users/romancandlethoughts/received_events","type":"User","site_admin":false},"body":"comma","created_at":"2017-01-30T16:07:32Z","updated_at":"2017-01-30T16:26:14Z","html_url":"https://github.com/alleyinteractive/apple-news/pull/293#discussion_r98474448","pull_request_url":"https://api.github.com/repos/alleyinteractive/apple-news/pulls/293","_links":{"self":{"href":"https://api.github.com/repos/alleyinteractive/apple-news/pulls/comments/98474448"},"html":{"href":"https://github.com/alleyinteractive/apple-news/pull/293#discussion_r98474448"},"pull_request":{"href":"https://api.github.com/repos/alleyinteractive/apple-news/pulls/293"}}},"pull_request":{"url":"https://api.github.com/repos/alleyinteractive/apple-news/pulls/293","id":103635870,"html_url":"https://github.com/alleyinteractive/apple-news/pull/293","diff_url":"https://github.com/alleyinteractive/apple-news/pull/293.diff","patch_url":"https://github.com/alleyinteractive/apple-news/pull/293.patch","issue_url":"https://api.github.com/repos/alleyinteractive/apple-news/issues/293","number":293,"state":"open","locked":false,"title":"Preview functionality for Apple News themes","user":{"login":"bcampeau","id":966849,"avatar_url":"https://avatars.githubusercontent.com/u/966849?v=3","gravatar_id":"","url":"https://api.github.com/users/bcampeau","html_url":"https://github.com/bcampeau","followers_url":"https://api.github.com/users/bcampeau/followers","following_url":"https://api.github.com/users/bcampeau/following{/other_user}","gists_url":"https://api.github.com/users/bcampeau/gists{/gist_id}","starred_url":"https://api.github.com/users/bcampeau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcampeau/subscriptions","organizations_url":"https://api.github.com/users/bcampeau/orgs","repos_url":"https://api.github.com/users/bcampeau/repos","events_url":"https://api.github.com/users/bcampeau/events{/privacy}","received_events_url":"https://api.github.com/users/bcampeau/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-01-29T05:25:03Z","updated_at":"2017-01-30T16:26:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"65898b5b58ef94018756cac544ea75466d465e7f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/alleyinteractive/apple-news/pulls/293/commits","review_comments_url":"https://api.github.com/repos/alleyinteractive/apple-news/pulls/293/comments","review_comment_url":"https://api.github.com/repos/alleyinteractive/apple-news/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alleyinteractive/apple-news/issues/293/comments","statuses_url":"https://api.github.com/repos/alleyinteractive/apple-news/statuses/6678c0effc8fa803b108f7318b641bee19a609e0","head":{"label":"alleyinteractive:180-preview","ref":"180-preview","sha":"6678c0effc8fa803b108f7318b641bee19a609e0","user":{"login":"alleyinteractive","id":1733454,"avatar_url":"https://avatars.githubusercontent.com/u/1733454?v=3","gravatar_id":"","url":"https://api.github.com/users/alleyinteractive","html_url":"https://github.com/alleyinteractive","followers_url":"https://api.github.com/users/alleyinteractive/followers","following_url":"https://api.github.com/users/alleyinteractive/following{/other_user}","gists_url":"https://api.github.com/users/alleyinteractive/gists{/gist_id}","starred_url":"https://api.github.com/users/alleyinteractive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alleyinteractive/subscriptions","organizations_url":"https://api.github.com/users/alleyinteractive/orgs","repos_url":"https://api.github.com/users/alleyinteractive/repos","events_url":"https://api.github.com/users/alleyinteractive/events{/privacy}","received_events_url":"https://api.github.com/users/alleyinteractive/received_events","type":"Organization","site_admin":false},"repo":{"id":41824143,"name":"apple-news","full_name":"alleyinteractive/apple-news","owner":{"login":"alleyinteractive","id":1733454,"avatar_url":"https://avatars.githubusercontent.com/u/1733454?v=3","gravatar_id":"","url":"https://api.github.com/users/alleyinteractive","html_url":"https://github.com/alleyinteractive","followers_url":"https://api.github.com/users/alleyinteractive/followers","following_url":"https://api.github.com/users/alleyinteractive/following{/other_user}","gists_url":"https://api.github.com/users/alleyinteractive/gists{/gist_id}","starred_url":"https://api.github.com/users/alleyinteractive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alleyinteractive/subscriptions","organizations_url":"https://api.github.com/users/alleyinteractive/orgs","repos_url":"https://api.github.com/users/alleyinteractive/repos","events_url":"https://api.github.com/users/alleyinteractive/events{/privacy}","received_events_url":"https://api.github.com/users/alleyinteractive/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alleyinteractive/apple-news","description":null,"fork":true,"url":"https://api.github.com/repos/alleyinteractive/apple-news","forks_url":"https://api.github.com/repos/alleyinteractive/apple-news/forks","keys_url":"https://api.github.com/repos/alleyinteractive/apple-news/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alleyinteractive/apple-news/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alleyinteractive/apple-news/teams","hooks_url":"https://api.github.com/repos/alleyinteractive/apple-news/hooks","issue_events_url":"https://api.github.com/repos/alleyinteractive/apple-news/issues/events{/number}","events_url":"https://api.github.com/repos/alleyinteractive/apple-news/events","assignees_url":"https://api.github.com/repos/alleyinteractive/apple-news/assignees{/user}","branches_url":"https://api.github.com/repos/alleyinteractive/apple-news/branches{/branch}","tags_url":"https://api.github.com/repos/alleyinteractive/apple-news/tags","blobs_url":"https://api.github.com/repos/alleyinteractive/apple-news/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alleyinteractive/apple-news/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alleyinteractive/apple-news/git/refs{/sha}","trees_url":"https://api.github.com/repos/alleyinteractive/apple-news/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alleyinteractive/apple-news/statuses/{sha}","languages_url":"https://api.github.com/repos/alleyinteractive/apple-news/languages","stargazers_url":"https://api.github.com/repos/alleyinteractive/apple-news/stargazers","contributors_url":"https://api.github.com/repos/alleyinteractive/apple-news/contributors","subscribers_url":"https://api.github.com/repos/alleyinteractive/apple-news/subscribers","subscription_url":"https://api.github.com/repos/alleyinteractive/apple-news/subscription","commits_url":"https://api.github.com/repos/alleyinteractive/apple-news/commits{/sha}","git_commits_url":"https://api.github.com/repos/alleyinteractive/apple-news/git/commits{/sha}","comments_url":"https://api.github.com/repos/alleyinteractive/apple-news/comments{/number}","issue_comment_url":"https://api.github.com/repos/alleyinteractive/apple-news/issues/comments{/number}","contents_url":"https://api.github.com/repos/alleyinteractive/apple-news/contents/{+path}","compare_url":"https://api.github.com/repos/alleyinteractive/apple-news/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alleyinteractive/apple-news/merges","archive_url":"https://api.github.com/repos/alleyinteractive/apple-news/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alleyinteractive/apple-news/downloads","issues_url":"https://api.github.com/repos/alleyinteractive/apple-news/issues{/number}","pulls_url":"https://api.github.com/repos/alleyinteractive/apple-news/pulls{/number}","milestones_url":"https://api.github.com/repos/alleyinteractive/apple-news/milestones{/number}","notifications_url":"https://api.github.com/repos/alleyinteractive/apple-news/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alleyinteractive/apple-news/labels{/name}","releases_url":"https://api.github.com/repos/alleyinteractive/apple-news/releases{/id}","deployments_url":"https://api.github.com/repos/alleyinteractive/apple-news/deployments","created_at":"2015-09-02T19:49:43Z","updated_at":"2017-01-30T15:39:29Z","pushed_at":"2017-01-30T15:44:25Z","git_url":"git://github.com/alleyinteractive/apple-news.git","ssh_url":"git@github.com:alleyinteractive/apple-news.git","clone_url":"https://github.com/alleyinteractive/apple-news.git","svn_url":"https://github.com/alleyinteractive/apple-news","homepage":null,"size":4793,"stargazers_count":80,"watchers_count":80,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":31,"forks":24,"open_issues":31,"watchers":80,"default_branch":"master"}},"base":{"label":"alleyinteractive:master","ref":"master","sha":"cd16de5aac37a68e751c9468cae2ba34bf9f0863","user":{"login":"alleyinteractive","id":1733454,"avatar_url":"https://avatars.githubusercontent.com/u/1733454?v=3","gravatar_id":"","url":"https://api.github.com/users/alleyinteractive","html_url":"https://github.com/alleyinteractive","followers_url":"https://api.github.com/users/alleyinteractive/followers","following_url":"https://api.github.com/users/alleyinteractive/following{/other_user}","gists_url":"https://api.github.com/users/alleyinteractive/gists{/gist_id}","starred_url":"https://api.github.com/users/alleyinteractive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alleyinteractive/subscriptions","organizations_url":"https://api.github.com/users/alleyinteractive/orgs","repos_url":"https://api.github.com/users/alleyinteractive/repos","events_url":"https://api.github.com/users/alleyinteractive/events{/privacy}","received_events_url":"https://api.github.com/users/alleyinteractive/received_events","type":"Organization","site_admin":false},"repo":{"id":41824143,"name":"apple-news","full_name":"alleyinteractive/apple-news","owner":{"login":"alleyinteractive","id":1733454,"avatar_url":"https://avatars.githubusercontent.com/u/1733454?v=3","gravatar_id":"","url":"https://api.github.com/users/alleyinteractive","html_url":"https://github.com/alleyinteractive","followers_url":"https://api.github.com/users/alleyinteractive/followers","following_url":"https://api.github.com/users/alleyinteractive/following{/other_user}","gists_url":"https://api.github.com/users/alleyinteractive/gists{/gist_id}","starred_url":"https://api.github.com/users/alleyinteractive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alleyinteractive/subscriptions","organizations_url":"https://api.github.com/users/alleyinteractive/orgs","repos_url":"https://api.github.com/users/alleyinteractive/repos","events_url":"https://api.github.com/users/alleyinteractive/events{/privacy}","received_events_url":"https://api.github.com/users/alleyinteractive/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alleyinteractive/apple-news","description":null,"fork":true,"url":"https://api.github.com/repos/alleyinteractive/apple-news","forks_url":"https://api.github.com/repos/alleyinteractive/apple-news/forks","keys_url":"https://api.github.com/repos/alleyinteractive/apple-news/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alleyinteractive/apple-news/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alleyinteractive/apple-news/teams","hooks_url":"https://api.github.com/repos/alleyinteractive/apple-news/hooks","issue_events_url":"https://api.github.com/repos/alleyinteractive/apple-news/issues/events{/number}","events_url":"https://api.github.com/repos/alleyinteractive/apple-news/events","assignees_url":"https://api.github.com/repos/alleyinteractive/apple-news/assignees{/user}","branches_url":"https://api.github.com/repos/alleyinteractive/apple-news/branches{/branch}","tags_url":"https://api.github.com/repos/alleyinteractive/apple-news/tags","blobs_url":"https://api.github.com/repos/alleyinteractive/apple-news/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alleyinteractive/apple-news/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alleyinteractive/apple-news/git/refs{/sha}","trees_url":"https://api.github.com/repos/alleyinteractive/apple-news/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alleyinteractive/apple-news/statuses/{sha}","languages_url":"https://api.github.com/repos/alleyinteractive/apple-news/languages","stargazers_url":"https://api.github.com/repos/alleyinteractive/apple-news/stargazers","contributors_url":"https://api.github.com/repos/alleyinteractive/apple-news/contributors","subscribers_url":"https://api.github.com/repos/alleyinteractive/apple-news/subscribers","subscription_url":"https://api.github.com/repos/alleyinteractive/apple-news/subscription","commits_url":"https://api.github.com/repos/alleyinteractive/apple-news/commits{/sha}","git_commits_url":"https://api.github.com/repos/alleyinteractive/apple-news/git/commits{/sha}","comments_url":"https://api.github.com/repos/alleyinteractive/apple-news/comments{/number}","issue_comment_url":"https://api.github.com/repos/alleyinteractive/apple-news/issues/comments{/number}","contents_url":"https://api.github.com/repos/alleyinteractive/apple-news/contents/{+path}","compare_url":"https://api.github.com/repos/alleyinteractive/apple-news/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alleyinteractive/apple-news/merges","archive_url":"https://api.github.com/repos/alleyinteractive/apple-news/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alleyinteractive/apple-news/downloads","issues_url":"https://api.github.com/repos/alleyinteractive/apple-news/issues{/number}","pulls_url":"https://api.github.com/repos/alleyinteractive/apple-news/pulls{/number}","milestones_url":"https://api.github.com/repos/alleyinteractive/apple-news/milestones{/number}","notifications_url":"https://api.github.com/repos/alleyinteractive/apple-news/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alleyinteractive/apple-news/labels{/name}","releases_url":"https://api.github.com/repos/alleyinteractive/apple-news/releases{/id}","deployments_url":"https://api.github.com/repos/alleyinteractive/apple-news/deployments","created_at":"2015-09-02T19:49:43Z","updated_at":"2017-01-30T15:39:29Z","pushed_at":"2017-01-30T15:44:25Z","git_url":"git://github.com/alleyinteractive/apple-news.git","ssh_url":"git@github.com:alleyinteractive/apple-news.git","clone_url":"https://github.com/alleyinteractive/apple-news.git","svn_url":"https://github.com/alleyinteractive/apple-news","homepage":null,"size":4793,"stargazers_count":80,"watchers_count":80,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":31,"forks":24,"open_issues":31,"watchers":80,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alleyinteractive/apple-news/pulls/293"},"html":{"href":"https://github.com/alleyinteractive/apple-news/pull/293"},"issue":{"href":"https://api.github.com/repos/alleyinteractive/apple-news/issues/293"},"comments":{"href":"https://api.github.com/repos/alleyinteractive/apple-news/issues/293/comments"},"review_comments":{"href":"https://api.github.com/repos/alleyinteractive/apple-news/pulls/293/comments"},"review_comment":{"href":"https://api.github.com/repos/alleyinteractive/apple-news/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alleyinteractive/apple-news/pulls/293/commits"},"statuses":{"href":"https://api.github.com/repos/alleyinteractive/apple-news/statuses/6678c0effc8fa803b108f7318b641bee19a609e0"}}}}
{"actor":{"display_login":"romancandlethoughts"}}