{"action":"created","comment":{"url":"https://api.github.com/repos/Yoast/wordpress-seo/pulls/comments/29744471","id":29744471,"diff_hunk":"@@ -302,9 +314,7 @@ function redirect( $query ) {\n \t\t}\n \n \t\t$n = get_query_var( 'sitemap_n' );\n-\t\tif ( is_scalar( $n ) && intval( $n ) > 0 ) {\n-\t\t\t$this->n = intval( $n );\n-\t\t}\n+\t\t$this->set_n( $n );\n \t\tunset( $n );","path":"inc/class-sitemaps.php","position":27,"original_position":27,"commit_id":"ccbbef56005e2068749a35e483012eba2aa90001","original_commit_id":"ccbbef56005e2068749a35e483012eba2aa90001","user":{"login":"jdevalk","id":487629,"avatar_url":"https://avatars.githubusercontent.com/u/487629?v=3","gravatar_id":"","url":"https://api.github.com/users/jdevalk","html_url":"https://github.com/jdevalk","followers_url":"https://api.github.com/users/jdevalk/followers","following_url":"https://api.github.com/users/jdevalk/following{/other_user}","gists_url":"https://api.github.com/users/jdevalk/gists{/gist_id}","starred_url":"https://api.github.com/users/jdevalk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdevalk/subscriptions","organizations_url":"https://api.github.com/users/jdevalk/orgs","repos_url":"https://api.github.com/users/jdevalk/repos","events_url":"https://api.github.com/users/jdevalk/events{/privacy}","received_events_url":"https://api.github.com/users/jdevalk/received_events","type":"User","site_admin":false},"body":"This whole bit can be optimized into:\r\n\r\n```php\r\n$this->set_n( get_query_var( 'sitemap_n' ) );\r\n```\r\n\r\nto prevent the whole set / unset.","created_at":"2015-05-06T09:23:27Z","updated_at":"2015-05-06T09:23:27Z","html_url":"https://github.com/Yoast/wordpress-seo/pull/2334#discussion_r29744471","pull_request_url":"https://api.github.com/repos/Yoast/wordpress-seo/pulls/2334","_links":{"self":{"href":"https://api.github.com/repos/Yoast/wordpress-seo/pulls/comments/29744471"},"html":{"href":"https://github.com/Yoast/wordpress-seo/pull/2334#discussion_r29744471"},"pull_request":{"href":"https://api.github.com/repos/Yoast/wordpress-seo/pulls/2334"}}},"pull_request":{"url":"https://api.github.com/repos/Yoast/wordpress-seo/pulls/2334","id":34108105,"html_url":"https://github.com/Yoast/wordpress-seo/pull/2334","diff_url":"https://github.com/Yoast/wordpress-seo/pull/2334.diff","patch_url":"https://github.com/Yoast/wordpress-seo/pull/2334.patch","issue_url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/2334","number":2334,"state":"open","locked":false,"title":"Add setter method for $n in class WPSEO_Sitemaps.","user":{"login":"larsschenk","id":169186,"avatar_url":"https://avatars.githubusercontent.com/u/169186?v=3","gravatar_id":"","url":"https://api.github.com/users/larsschenk","html_url":"https://github.com/larsschenk","followers_url":"https://api.github.com/users/larsschenk/followers","following_url":"https://api.github.com/users/larsschenk/following{/other_user}","gists_url":"https://api.github.com/users/larsschenk/gists{/gist_id}","starred_url":"https://api.github.com/users/larsschenk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsschenk/subscriptions","organizations_url":"https://api.github.com/users/larsschenk/orgs","repos_url":"https://api.github.com/users/larsschenk/repos","events_url":"https://api.github.com/users/larsschenk/events{/privacy}","received_events_url":"https://api.github.com/users/larsschenk/received_events","type":"User","site_admin":false},"body":"This will allow wp-cli to create partial sitemaps.\r\nCloses #2332.","created_at":"2015-04-25T15:39:19Z","updated_at":"2015-05-06T09:23:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"016056ce7641a805b84bbbedd22a224eafa55105","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Yoast/wordpress-seo/pulls/2334/commits","review_comments_url":"https://api.github.com/repos/Yoast/wordpress-seo/pulls/2334/comments","review_comment_url":"https://api.github.com/repos/Yoast/wordpress-seo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/2334/comments","statuses_url":"https://api.github.com/repos/Yoast/wordpress-seo/statuses/ccbbef56005e2068749a35e483012eba2aa90001","head":{"label":"larsschenk:trunk","ref":"trunk","sha":"ccbbef56005e2068749a35e483012eba2aa90001","user":{"login":"larsschenk","id":169186,"avatar_url":"https://avatars.githubusercontent.com/u/169186?v=3","gravatar_id":"","url":"https://api.github.com/users/larsschenk","html_url":"https://github.com/larsschenk","followers_url":"https://api.github.com/users/larsschenk/followers","following_url":"https://api.github.com/users/larsschenk/following{/other_user}","gists_url":"https://api.github.com/users/larsschenk/gists{/gist_id}","starred_url":"https://api.github.com/users/larsschenk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsschenk/subscriptions","organizations_url":"https://api.github.com/users/larsschenk/orgs","repos_url":"https://api.github.com/users/larsschenk/repos","events_url":"https://api.github.com/users/larsschenk/events{/privacy}","received_events_url":"https://api.github.com/users/larsschenk/received_events","type":"User","site_admin":false},"repo":{"id":34571000,"name":"wordpress-seo","full_name":"larsschenk/wordpress-seo","owner":{"login":"larsschenk","id":169186,"avatar_url":"https://avatars.githubusercontent.com/u/169186?v=3","gravatar_id":"","url":"https://api.github.com/users/larsschenk","html_url":"https://github.com/larsschenk","followers_url":"https://api.github.com/users/larsschenk/followers","following_url":"https://api.github.com/users/larsschenk/following{/other_user}","gists_url":"https://api.github.com/users/larsschenk/gists{/gist_id}","starred_url":"https://api.github.com/users/larsschenk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsschenk/subscriptions","organizations_url":"https://api.github.com/users/larsschenk/orgs","repos_url":"https://api.github.com/users/larsschenk/repos","events_url":"https://api.github.com/users/larsschenk/events{/privacy}","received_events_url":"https://api.github.com/users/larsschenk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/larsschenk/wordpress-seo","description":"WordPress SEO","fork":true,"url":"https://api.github.com/repos/larsschenk/wordpress-seo","forks_url":"https://api.github.com/repos/larsschenk/wordpress-seo/forks","keys_url":"https://api.github.com/repos/larsschenk/wordpress-seo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/larsschenk/wordpress-seo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/larsschenk/wordpress-seo/teams","hooks_url":"https://api.github.com/repos/larsschenk/wordpress-seo/hooks","issue_events_url":"https://api.github.com/repos/larsschenk/wordpress-seo/issues/events{/number}","events_url":"https://api.github.com/repos/larsschenk/wordpress-seo/events","assignees_url":"https://api.github.com/repos/larsschenk/wordpress-seo/assignees{/user}","branches_url":"https://api.github.com/repos/larsschenk/wordpress-seo/branches{/branch}","tags_url":"https://api.github.com/repos/larsschenk/wordpress-seo/tags","blobs_url":"https://api.github.com/repos/larsschenk/wordpress-seo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/larsschenk/wordpress-seo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/larsschenk/wordpress-seo/git/refs{/sha}","trees_url":"https://api.github.com/repos/larsschenk/wordpress-seo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/larsschenk/wordpress-seo/statuses/{sha}","languages_url":"https://api.github.com/repos/larsschenk/wordpress-seo/languages","stargazers_url":"https://api.github.com/repos/larsschenk/wordpress-seo/stargazers","contributors_url":"https://api.github.com/repos/larsschenk/wordpress-seo/contributors","subscribers_url":"https://api.github.com/repos/larsschenk/wordpress-seo/subscribers","subscription_url":"https://api.github.com/repos/larsschenk/wordpress-seo/subscription","commits_url":"https://api.github.com/repos/larsschenk/wordpress-seo/commits{/sha}","git_commits_url":"https://api.github.com/repos/larsschenk/wordpress-seo/git/commits{/sha}","comments_url":"https://api.github.com/repos/larsschenk/wordpress-seo/comments{/number}","issue_comment_url":"https://api.github.com/repos/larsschenk/wordpress-seo/issues/comments{/number}","contents_url":"https://api.github.com/repos/larsschenk/wordpress-seo/contents/{+path}","compare_url":"https://api.github.com/repos/larsschenk/wordpress-seo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/larsschenk/wordpress-seo/merges","archive_url":"https://api.github.com/repos/larsschenk/wordpress-seo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/larsschenk/wordpress-seo/downloads","issues_url":"https://api.github.com/repos/larsschenk/wordpress-seo/issues{/number}","pulls_url":"https://api.github.com/repos/larsschenk/wordpress-seo/pulls{/number}","milestones_url":"https://api.github.com/repos/larsschenk/wordpress-seo/milestones{/number}","notifications_url":"https://api.github.com/repos/larsschenk/wordpress-seo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/larsschenk/wordpress-seo/labels{/name}","releases_url":"https://api.github.com/repos/larsschenk/wordpress-seo/releases{/id}","created_at":"2015-04-25T14:13:15Z","updated_at":"2015-05-05T12:30:14Z","pushed_at":"2015-05-05T12:30:14Z","git_url":"git://github.com/larsschenk/wordpress-seo.git","ssh_url":"git@github.com:larsschenk/wordpress-seo.git","clone_url":"https://github.com/larsschenk/wordpress-seo.git","svn_url":"https://github.com/larsschenk/wordpress-seo","homepage":"http://yoast.com/wordpress/seo/","size":12525,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"trunk"}},"base":{"label":"Yoast:trunk","ref":"trunk","sha":"39b5a3945988cc120745ecb1962a53dbfc20c89c","user":{"login":"Yoast","id":4690436,"avatar_url":"https://avatars.githubusercontent.com/u/4690436?v=3","gravatar_id":"","url":"https://api.github.com/users/Yoast","html_url":"https://github.com/Yoast","followers_url":"https://api.github.com/users/Yoast/followers","following_url":"https://api.github.com/users/Yoast/following{/other_user}","gists_url":"https://api.github.com/users/Yoast/gists{/gist_id}","starred_url":"https://api.github.com/users/Yoast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yoast/subscriptions","organizations_url":"https://api.github.com/users/Yoast/orgs","repos_url":"https://api.github.com/users/Yoast/repos","events_url":"https://api.github.com/users/Yoast/events{/privacy}","received_events_url":"https://api.github.com/users/Yoast/received_events","type":"Organization","site_admin":false},"repo":{"id":6723399,"name":"wordpress-seo","full_name":"Yoast/wordpress-seo","owner":{"login":"Yoast","id":4690436,"avatar_url":"https://avatars.githubusercontent.com/u/4690436?v=3","gravatar_id":"","url":"https://api.github.com/users/Yoast","html_url":"https://github.com/Yoast","followers_url":"https://api.github.com/users/Yoast/followers","following_url":"https://api.github.com/users/Yoast/following{/other_user}","gists_url":"https://api.github.com/users/Yoast/gists{/gist_id}","starred_url":"https://api.github.com/users/Yoast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yoast/subscriptions","organizations_url":"https://api.github.com/users/Yoast/orgs","repos_url":"https://api.github.com/users/Yoast/repos","events_url":"https://api.github.com/users/Yoast/events{/privacy}","received_events_url":"https://api.github.com/users/Yoast/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yoast/wordpress-seo","description":"WordPress SEO","fork":false,"url":"https://api.github.com/repos/Yoast/wordpress-seo","forks_url":"https://api.github.com/repos/Yoast/wordpress-seo/forks","keys_url":"https://api.github.com/repos/Yoast/wordpress-seo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yoast/wordpress-seo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yoast/wordpress-seo/teams","hooks_url":"https://api.github.com/repos/Yoast/wordpress-seo/hooks","issue_events_url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/events{/number}","events_url":"https://api.github.com/repos/Yoast/wordpress-seo/events","assignees_url":"https://api.github.com/repos/Yoast/wordpress-seo/assignees{/user}","branches_url":"https://api.github.com/repos/Yoast/wordpress-seo/branches{/branch}","tags_url":"https://api.github.com/repos/Yoast/wordpress-seo/tags","blobs_url":"https://api.github.com/repos/Yoast/wordpress-seo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yoast/wordpress-seo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yoast/wordpress-seo/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yoast/wordpress-seo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yoast/wordpress-seo/statuses/{sha}","languages_url":"https://api.github.com/repos/Yoast/wordpress-seo/languages","stargazers_url":"https://api.github.com/repos/Yoast/wordpress-seo/stargazers","contributors_url":"https://api.github.com/repos/Yoast/wordpress-seo/contributors","subscribers_url":"https://api.github.com/repos/Yoast/wordpress-seo/subscribers","subscription_url":"https://api.github.com/repos/Yoast/wordpress-seo/subscription","commits_url":"https://api.github.com/repos/Yoast/wordpress-seo/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yoast/wordpress-seo/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yoast/wordpress-seo/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yoast/wordpress-seo/contents/{+path}","compare_url":"https://api.github.com/repos/Yoast/wordpress-seo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yoast/wordpress-seo/merges","archive_url":"https://api.github.com/repos/Yoast/wordpress-seo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yoast/wordpress-seo/downloads","issues_url":"https://api.github.com/repos/Yoast/wordpress-seo/issues{/number}","pulls_url":"https://api.github.com/repos/Yoast/wordpress-seo/pulls{/number}","milestones_url":"https://api.github.com/repos/Yoast/wordpress-seo/milestones{/number}","notifications_url":"https://api.github.com/repos/Yoast/wordpress-seo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yoast/wordpress-seo/labels{/name}","releases_url":"https://api.github.com/repos/Yoast/wordpress-seo/releases{/id}","created_at":"2012-11-16T15:16:29Z","updated_at":"2015-05-05T10:41:29Z","pushed_at":"2015-05-05T14:51:12Z","git_url":"git://github.com/Yoast/wordpress-seo.git","ssh_url":"git@github.com:Yoast/wordpress-seo.git","clone_url":"https://github.com/Yoast/wordpress-seo.git","svn_url":"https://github.com/Yoast/wordpress-seo","homepage":"http://yoast.com/wordpress/seo/","size":23196,"stargazers_count":472,"watchers_count":472,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":286,"mirror_url":null,"open_issues_count":323,"forks":286,"open_issues":323,"watchers":472,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/Yoast/wordpress-seo/pulls/2334"},"html":{"href":"https://github.com/Yoast/wordpress-seo/pull/2334"},"issue":{"href":"https://api.github.com/repos/Yoast/wordpress-seo/issues/2334"},"comments":{"href":"https://api.github.com/repos/Yoast/wordpress-seo/issues/2334/comments"},"review_comments":{"href":"https://api.github.com/repos/Yoast/wordpress-seo/pulls/2334/comments"},"review_comment":{"href":"https://api.github.com/repos/Yoast/wordpress-seo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Yoast/wordpress-seo/pulls/2334/commits"},"statuses":{"href":"https://api.github.com/repos/Yoast/wordpress-seo/statuses/ccbbef56005e2068749a35e483012eba2aa90001"}}}}