Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 9545b15

Browse files
Merge pull request #116 from wordpress-mobile/issue/fix_tag_sync
Fix of numerical tag sync on WP.com
2 parents 8314be0 + 03ea6b4 commit 9545b15

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

WordPressKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "WordPressKit"
3-
s.version = "3.0.0-beta.1"
3+
s.version = "3.0.0-beta.2"
44
s.summary = "WordPressKit offers a clean and simple WordPress.com and WordPress.org API."
55

66
s.description = <<-DESC

WordPressKit/PostServiceRemoteREST.m

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ - (void)getPostWithID:(NSNumber *)postID
3434

3535
NSString *path = [NSString stringWithFormat:@"sites/%@/posts/%@", self.siteID, postID];
3636
NSString *requestUrl = [self pathForEndpoint:path
37-
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];
37+
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_2];
3838

3939
NSDictionary *parameters = @{ @"context": @"edit" };
4040

@@ -67,7 +67,7 @@ - (void)getPostsOfType:(NSString *)postType
6767

6868
NSString *path = [NSString stringWithFormat:@"sites/%@/posts", self.siteID];
6969
NSString *requestUrl = [self pathForEndpoint:path
70-
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];
70+
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_2];
7171

7272
NSDictionary *parameters = @{
7373
@"status": @"any,trash",
@@ -101,7 +101,7 @@ - (void)createPost:(RemotePost *)post
101101

102102
NSString *path = [NSString stringWithFormat:@"sites/%@/posts/new?context=edit", self.siteID];
103103
NSString *requestUrl = [self pathForEndpoint:path
104-
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];
104+
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_2];
105105

106106
NSDictionary *parameters = [self parametersWithRemotePost:post];
107107

@@ -131,7 +131,7 @@ - (void)createPost:(RemotePost *)post
131131
NSString *filename = media.file;
132132
NSString *path = [NSString stringWithFormat:@"sites/%@/posts/new", self.siteID];
133133
NSString *requestUrl = [self pathForEndpoint:path
134-
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];
134+
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_2];
135135

136136
NSMutableDictionary *parameters = [NSMutableDictionary dictionaryWithDictionary:@{}];
137137
parameters[@"content"] = post.content;
@@ -165,7 +165,7 @@ - (void)updatePost:(RemotePost *)post
165165

166166
NSString *path = [NSString stringWithFormat:@"sites/%@/posts/%@?context=edit", self.siteID, post.postID];
167167
NSString *requestUrl = [self pathForEndpoint:path
168-
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];
168+
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_2];
169169

170170
NSDictionary *parameters = [self parametersWithRemotePost:post];
171171

@@ -429,7 +429,9 @@ - (NSDictionary *)parametersWithRemotePost:(RemotePost *)post
429429
parameters[@"categories"] = [post.categories valueForKey:@"categoryID"];
430430
}
431431
if (post.tags) {
432-
parameters[@"tags"] = post.tags;
432+
NSArray *tags = post.tags;
433+
NSDictionary *postTags = @{@"post_tag":tags};
434+
parameters[@"terms"] = postTags;
433435
}
434436
if (post.format) {
435437
parameters[@"format"] = post.format;

WordPressKitTests/PostServiceRemoteRESTTests.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ - (void)testThatGetPostWithIDWorks
3838
NSNumber *postID = @1;
3939
NSString *endpoint = [NSString stringWithFormat:@"sites/%@/posts/%@", dotComID, postID];
4040
NSString *url = [service pathForEndpoint:endpoint
41-
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];
41+
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_2];
4242

4343
OCMStub([api GET:[OCMArg isEqual:url]
4444
parameters:[OCMArg isNotNil]
@@ -74,7 +74,7 @@ - (void)testThatGetPostsOfTypeWorks
7474

7575
NSString *endpoint = [NSString stringWithFormat:@"sites/%@/posts", dotComID];
7676
NSString *url = [service pathForEndpoint:endpoint
77-
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];
77+
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_2];
7878

7979
BOOL (^parametersCheckBlock)(id obj) = ^BOOL(NSDictionary *parameters) {
8080

@@ -105,7 +105,7 @@ - (void)testThatGetPostsOfTypeWithOptionsWorks
105105

106106
NSString *endpoint = [NSString stringWithFormat:@"sites/%@/posts", dotComID];
107107
NSString *url = [service pathForEndpoint:endpoint
108-
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];
108+
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_2];
109109

110110
NSString *testOptionKey = @"SomeKey";
111111
NSString *testOptionValue = @"SomeValue";
@@ -151,7 +151,7 @@ - (void)testThatCreatePostWorks
151151

152152
NSString *endpoint = [NSString stringWithFormat:@"sites/%@/posts/new?context=edit", dotComID];
153153
NSString *url = [service pathForEndpoint:endpoint
154-
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];
154+
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_2];
155155

156156
OCMStub([api POST:[OCMArg isEqual:url]
157157
parameters:[OCMArg isKindOfClass:[NSDictionary class]]
@@ -196,7 +196,7 @@ - (void)testThatUpdatePostWorks
196196

197197
NSString *endpoint = [NSString stringWithFormat:@"sites/%@/posts/%@?context=edit", dotComID, post.postID];
198198
NSString *url = [service pathForEndpoint:endpoint
199-
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];
199+
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_2];
200200

201201
OCMStub([api POST:[OCMArg isEqual:url]
202202
parameters:[OCMArg isKindOfClass:[NSDictionary class]]

0 commit comments

Comments
 (0)