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

Commit 8f28994

Browse files
committed
Parse the menu_order property in posts list
1 parent ba542ba commit 8f28994

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

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)