{"action":"created","comment":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments/37061557","id":37061557,"diff_hunk":"@@ -235,25 +238,55 @@ - (NSArray *)sortedCategories\n     return [[self.categories allObjects] sortedArrayUsingDescriptors:sortDescriptors];\n }\n \n+- (NSArray *)sortedPostFormats\n+{\n+    if ([self.postFormats count] == 0) {\n+        return @[];\n+    }\n+    NSMutableArray *sortedFormats = [NSMutableArray arrayWithCapacity:[self.postFormats count]];\n+ \n+    if (self.postFormats[@\"standard\"]) {\n+        [sortedFormats addObject:@\"standard\"];\n+    }\n+    [self.postFormats enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {\n+        if (![key isEqual:@\"standard\"]) {\n+            [sortedFormats addObject:key];\n+        }\n+    }];\n+\n+    return [NSArray arrayWithArray:sortedFormats];\n+}\n+\n - (NSArray *)sortedPostFormatNames\n {\n     NSMutableArray *sortedNames = [NSMutableArray arrayWithCapacity:[self.postFormats count]];\n \n-    if ([self.postFormats count] != 0) {\n-        id standardPostFormat = [self.postFormats objectForKey:@\"standard\"];\n-        if (standardPostFormat) {\n-            [sortedNames addObject:standardPostFormat];\n-        }\n-        [self.postFormats enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {\n-            if (![key isEqual:@\"standard\"]) {\n-                [sortedNames addObject:obj];\n-            }\n-        }];\n+    for (NSString *key in self.sortedPostFormats) {\n+        [sortedNames addObject:self.postFormats[key]];","path":"WordPress/Classes/Models/Blog.m","position":48,"original_position":48,"commit_id":"5982d34b7de07abb6bd3fe541f5dbc358f579a65","original_commit_id":"5982d34b7de07abb6bd3fe541f5dbc358f579a65","user":{"login":"SergioEstevao","id":651601,"avatar_url":"https://avatars.githubusercontent.com/u/651601?v=3","gravatar_id":"","url":"https://api.github.com/users/SergioEstevao","html_url":"https://github.com/SergioEstevao","followers_url":"https://api.github.com/users/SergioEstevao/followers","following_url":"https://api.github.com/users/SergioEstevao/following{/other_user}","gists_url":"https://api.github.com/users/SergioEstevao/gists{/gist_id}","starred_url":"https://api.github.com/users/SergioEstevao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SergioEstevao/subscriptions","organizations_url":"https://api.github.com/users/SergioEstevao/orgs","repos_url":"https://api.github.com/users/SergioEstevao/repos","events_url":"https://api.github.com/users/SergioEstevao/events{/privacy}","received_events_url":"https://api.github.com/users/SergioEstevao/received_events","type":"User","site_admin":false},"body":"> I see that self hosted sites don't sync the values with the server, but still apply them locally, which seems good enough to me. Is that the desired behavior?\r\n\r\nYep, because I think it avoids unnecessary work for users in the mobile app that create new posts and always needed to changes this.","created_at":"2015-08-14T09:25:42Z","updated_at":"2015-08-14T09:25:42Z","html_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/4143#discussion_r37061557","pull_request_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/4143","_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments/37061557"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-iOS/pull/4143#discussion_r37061557"},"pull_request":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/4143"}}},"pull_request":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/4143","id":42380209,"html_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/4143","diff_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/4143.diff","patch_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/4143.patch","issue_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/4143","number":4143,"state":"open","locked":false,"title":"Implement settings writing options","user":{"login":"SergioEstevao","id":651601,"avatar_url":"https://avatars.githubusercontent.com/u/651601?v=3","gravatar_id":"","url":"https://api.github.com/users/SergioEstevao","html_url":"https://github.com/SergioEstevao","followers_url":"https://api.github.com/users/SergioEstevao/followers","following_url":"https://api.github.com/users/SergioEstevao/following{/other_user}","gists_url":"https://api.github.com/users/SergioEstevao/gists{/gist_id}","starred_url":"https://api.github.com/users/SergioEstevao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SergioEstevao/subscriptions","organizations_url":"https://api.github.com/users/SergioEstevao/orgs","repos_url":"https://api.github.com/users/SergioEstevao/repos","events_url":"https://api.github.com/users/SergioEstevao/events{/privacy}","received_events_url":"https://api.github.com/users/SergioEstevao/received_events","type":"User","site_admin":false},"body":"This PR implements the Default Category and Default Post Format for a Blog.\r\nThese can be set on blog settings.\r\n\r\nHow to test:\r\n\r\n * Try to change the values for this settings\r\n * Check when creating a new post in the app  if the settings are applied\r\n * Check if the values are in sync with the web site.\r\n\r\nNeeds Review: @koke ","created_at":"2015-08-13T18:05:36Z","updated_at":"2015-08-14T09:25:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55fa3d78caa23519c4ef755a3a640bf18d87c08a","assignee":{"login":"SergioEstevao","id":651601,"avatar_url":"https://avatars.githubusercontent.com/u/651601?v=3","gravatar_id":"","url":"https://api.github.com/users/SergioEstevao","html_url":"https://github.com/SergioEstevao","followers_url":"https://api.github.com/users/SergioEstevao/followers","following_url":"https://api.github.com/users/SergioEstevao/following{/other_user}","gists_url":"https://api.github.com/users/SergioEstevao/gists{/gist_id}","starred_url":"https://api.github.com/users/SergioEstevao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SergioEstevao/subscriptions","organizations_url":"https://api.github.com/users/SergioEstevao/orgs","repos_url":"https://api.github.com/users/SergioEstevao/repos","events_url":"https://api.github.com/users/SergioEstevao/events{/privacy}","received_events_url":"https://api.github.com/users/SergioEstevao/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/milestones/45","html_url":"https://github.com/wordpress-mobile/WordPress-iOS/milestones/5.6","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/milestones/45/labels","id":1188115,"number":45,"title":"5.6","description":null,"creator":{"login":"sendhil","id":437043,"avatar_url":"https://avatars.githubusercontent.com/u/437043?v=3","gravatar_id":"","url":"https://api.github.com/users/sendhil","html_url":"https://github.com/sendhil","followers_url":"https://api.github.com/users/sendhil/followers","following_url":"https://api.github.com/users/sendhil/following{/other_user}","gists_url":"https://api.github.com/users/sendhil/gists{/gist_id}","starred_url":"https://api.github.com/users/sendhil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sendhil/subscriptions","organizations_url":"https://api.github.com/users/sendhil/orgs","repos_url":"https://api.github.com/users/sendhil/repos","events_url":"https://api.github.com/users/sendhil/events{/privacy}","received_events_url":"https://api.github.com/users/sendhil/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":18,"state":"open","created_at":"2015-06-30T23:23:14Z","updated_at":"2015-08-14T01:50:13Z","due_on":"2015-09-17T00:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/4143/commits","review_comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/4143/comments","review_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/4143/comments","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/statuses/5982d34b7de07abb6bd3fe541f5dbc358f579a65","head":{"label":"wordpress-mobile:issue/3970-ImplementSettins-WritingOptions","ref":"issue/3970-ImplementSettins-WritingOptions","sha":"5982d34b7de07abb6bd3fe541f5dbc358f579a65","user":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":8859285,"name":"WordPress-iOS","full_name":"wordpress-mobile/WordPress-iOS","owner":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wordpress-mobile/WordPress-iOS","description":"WordPress for iOS - Official repository","fork":false,"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS","forks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/forks","keys_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/teams","hooks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/hooks","issue_events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/events","assignees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/tags","blobs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/languages","stargazers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/stargazers","contributors_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/contributors","subscribers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/subscribers","subscription_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/subscription","commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/merges","archive_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/downloads","issues_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/labels{/name}","releases_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/releases{/id}","created_at":"2013-03-18T16:59:33Z","updated_at":"2015-08-13T06:08:39Z","pushed_at":"2015-08-14T02:18:28Z","git_url":"git://github.com/wordpress-mobile/WordPress-iOS.git","ssh_url":"git@github.com:wordpress-mobile/WordPress-iOS.git","clone_url":"https://github.com/wordpress-mobile/WordPress-iOS.git","svn_url":"https://github.com/wordpress-mobile/WordPress-iOS","homepage":"http://ios.wordpress.org/","size":401431,"stargazers_count":669,"watchers_count":669,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":343,"mirror_url":null,"open_issues_count":369,"forks":343,"open_issues":369,"watchers":669,"default_branch":"develop"}},"base":{"label":"wordpress-mobile:develop","ref":"develop","sha":"1a312d34f098b0f64b4574310345dbb29e6245de","user":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":8859285,"name":"WordPress-iOS","full_name":"wordpress-mobile/WordPress-iOS","owner":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wordpress-mobile/WordPress-iOS","description":"WordPress for iOS - Official repository","fork":false,"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS","forks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/forks","keys_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/teams","hooks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/hooks","issue_events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/events","assignees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/tags","blobs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/languages","stargazers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/stargazers","contributors_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/contributors","subscribers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/subscribers","subscription_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/subscription","commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/merges","archive_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/downloads","issues_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/labels{/name}","releases_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/releases{/id}","created_at":"2013-03-18T16:59:33Z","updated_at":"2015-08-13T06:08:39Z","pushed_at":"2015-08-14T02:18:28Z","git_url":"git://github.com/wordpress-mobile/WordPress-iOS.git","ssh_url":"git@github.com:wordpress-mobile/WordPress-iOS.git","clone_url":"https://github.com/wordpress-mobile/WordPress-iOS.git","svn_url":"https://github.com/wordpress-mobile/WordPress-iOS","homepage":"http://ios.wordpress.org/","size":401431,"stargazers_count":669,"watchers_count":669,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":343,"mirror_url":null,"open_issues_count":369,"forks":343,"open_issues":369,"watchers":669,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/4143"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-iOS/pull/4143"},"issue":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/4143"},"comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/4143/comments"},"review_comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/4143/comments"},"review_comment":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/4143/commits"},"statuses":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/statuses/5982d34b7de07abb6bd3fe541f5dbc358f579a65"}}}}