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

Commit 78e3184

Browse files
committed
Add RemotePost.ifNotModifiedSince
1 parent 911a054 commit 78e3184

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

WordPressKit/PostServiceRemoteREST.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,9 @@ - (NSDictionary *)parametersWithRemotePost:(RemotePost *)post
541541
// safety net. An existing post with no create date should publish immediately
542542
parameters[@"date"] = [[NSDate date] WordPressComJSONString];
543543
}
544+
if (post.ifNotModifiedSince) {
545+
parameters[@"if_not_modified_since"] = [post.ifNotModifiedSince WordPressComJSONString];
546+
}
544547
if (post.excerpt) {
545548
parameters[@"excerpt"] = post.excerpt;
546549
}

WordPressKit/PostServiceRemoteXMLRPC.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,10 @@ - (NSDictionary *)parametersWithRemotePost:(RemotePost *)post
407407
postParams[@"date_created_gmt"] = [NSDate date];
408408
}
409409

410+
if (post.ifNotModifiedSince) {
411+
postParams[@"if_not_modified_since"] = post.ifNotModifiedSince;
412+
}
413+
410414
if (post.categories) {
411415
NSArray *categoryNames = [post.categories wp_map:^id(RemotePostCategory *category) {
412416
return category.name;

WordPressKit/RemotePost.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ extern NSString * const PostStatusDeleted;
2121
@property (nonatomic, strong) NSNumber *authorID;
2222
@property (nonatomic, strong) NSDate *date;
2323
@property (nonatomic, strong) NSDate *dateModified;
24+
@property (nonatomic, strong) NSDate *ifNotModifiedSince;
2425
@property (nonatomic, strong) NSString *title;
2526
@property (nonatomic, strong) NSURL *URL;
2627
@property (nonatomic, strong) NSURL *shortURL;

0 commit comments

Comments
 (0)