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

Commit 94cbe7e

Browse files
authored
Parse the menu_order property in posts list (#832)
2 parents ed050d0 + 86f9eef commit 94cbe7e

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ let package = Package(
1111
targets: [
1212
.binaryTarget(
1313
name: "WordPressKit",
14-
url: "https://github.com/user-attachments/files/19658656/WordPressKit.zip",
15-
checksum: "9172f9b9906e64efe1f3d79f074ad317f1d40c6ce1ec394259b0f99fea6fe8ee"
14+
url: "https://github.com/user-attachments/files/19732825/WordPressKit.zip",
15+
checksum: "0ecd8b19cd00a4ef363ab6e826f92166c1efa4693db8f3218533510a3f951dbb"
1616
),
1717
]
1818
)

Sources/WordPressKit/Models/RemotePost.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ extern NSString * const PostStatusDeleted;
3636
@property (nonatomic, strong) NSString *postThumbnailPath;
3737
@property (nonatomic, strong) NSString *type;
3838
@property (nonatomic, strong) NSString *format;
39+
@property (nonatomic, assign) NSInteger order;
3940

4041
/**
4142
* A snapshot of the post at the last autosave.

Sources/WordPressKit/Services/PostServiceRemoteREST.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ + (RemotePost *)remotePostFromJSONDictionary:(NSDictionary *)jsonPost {
471471
post.postThumbnailPath = [postThumbnail stringForKeyPath:@"URL"];
472472
post.type = jsonPost[@"type"];
473473
post.format = jsonPost[@"format"];
474+
post.order = [jsonPost numberForKey:@"menu_order"].integerValue;
474475

475476
post.commentCount = [jsonPost numberForKeyPath:@"discussion.comment_count"] ?: @0;
476477
post.likeCount = [jsonPost numberForKeyPath:@"like_count"] ?: @0;

Sources/WordPressKit/Services/PostServiceRemoteXMLRPC.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ + (RemotePost *)remotePostFromXMLRPCDictionary:(NSDictionary *)xmlrpcDictionary
322322
post.postThumbnailPath = [thumbnailDict stringForKey:@"link"];
323323
post.type = xmlrpcDictionary[@"post_type"];
324324
post.format = xmlrpcDictionary[@"post_format"];
325+
post.order = [xmlrpcDictionary numberForKey:@"menu_order"].integerValue;
325326

326327
post.metadata = xmlrpcDictionary[@"custom_fields"];
327328

0 commit comments

Comments
 (0)