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

Commit 6c940e2

Browse files
authored
Merge pull request #44 from wordpress-mobile/feature/PPP-self-hosted
Enable self-hosted to set parent page
2 parents d7ef7d8 + 860ccda commit 6c940e2

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ PODS:
2727
- OHHTTPStubs/Swift (6.1.0):
2828
- OHHTTPStubs/Default
2929
- UIDeviceIdentifier (0.5.0)
30-
- WordPressKit (1.4.2-beta.1):
30+
- WordPressKit (1.4.2-beta.2):
3131
- Alamofire (~> 4.7.3)
3232
- CocoaLumberjack (= 3.4.2)
3333
- NSObject-SafeExpectations (= 0.0.3)
@@ -70,7 +70,7 @@ SPEC CHECKSUMS:
7070
OCMock: ebe9ee1dca7fbed0ff9193ac0b3e2d8862ea56f6
7171
OHHTTPStubs: 1e21c7d2c084b8153fc53d48400d8919d2d432d0
7272
UIDeviceIdentifier: a959a6d4f51036b4180dd31fb26483a820f1cc46
73-
WordPressKit: f520d09ee011f11ee8017aee640025cb017b5612
73+
WordPressKit: 1ff38b1bc95198b1cf40338461bdf0d71441fe42
7474
WordPressShared: fc613aa29351c73677c421daacb36eacf53f100d
7575
wpxmlrpc: bfc572f62ce7ee897f6f38b098d2ba08732ecef4
7676

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 = "1.4.2-beta.1"
3+
s.version = "1.4.2-beta.2"
44

55
s.summary = "WordPressKit offers a clean and simple WordPress.com and WordPress.org API."
66

WordPressKit/PostServiceRemoteXMLRPC.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ - (NSDictionary *)parametersWithRemotePost:(RemotePost *)post
414414
}
415415

416416
postParams[@"sticky"] = post.isStickyPost ? @"true" : @"false";
417+
postParams[@"wp_page_parent_id"] = post.parentID ? post.parentID.stringValue : @"0";
417418

418419
// Scheduled posts need to sync with a status of 'publish'.
419420
// Passing a status of 'future' will set the post status to 'draft'

WordPressKitTests/PostServiceRemoteXMLRPCTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class PostServiceRemoteXMLRPCTests: RemoteTestCase, XMLRPCTestable {
1010
let postTitle = "Hello world!"
1111
let postContent = "Welcome to WordPress."
1212
let postIsSticky = true
13+
let postParentId: NSNumber = 2
1314

1415
let getPostSuccessMockFilename = "xmlrpc-wp-getpost-success.xml"
1516
let getPostBadXMLFailureFilename = "xmlrpc-wp-getpost-bad-xml-failure.xml"
@@ -142,6 +143,7 @@ class PostServiceRemoteXMLRPCTests: RemoteTestCase, XMLRPCTestable {
142143
post.title = postTitle
143144
post.content = postContent
144145
post.isStickyPost = postIsSticky
146+
post.parentID = postParentId
145147
return post
146148
}()
147149

@@ -267,6 +269,7 @@ class PostServiceRemoteXMLRPCTests: RemoteTestCase, XMLRPCTestable {
267269
post.title = postTitle
268270
post.content = postContent
269271
post.isStickyPost = postIsSticky
272+
post.parentID = nil
270273
return post
271274
}()
272275

0 commit comments

Comments
 (0)