Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WordPressKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Pod::Spec.new do |s|
s.name = 'WordPressKit'
s.version = '4.44.0'
s.version = '4.45.0-beta.1'

s.summary = 'WordPressKit offers a clean and simple WordPress.com and WordPress.org API.'
s.description = <<-DESC
Expand Down
1 change: 1 addition & 0 deletions WordPressKit/CommentServiceRemoteREST.m
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ - (RemoteComment *)remoteCommentFromJSONDictionary:(NSDictionary *)jsonDictionar
{
RemoteComment *comment = [RemoteComment new];

comment.authorID = [jsonDictionary numberForKeyPath:@"author.ID"];
comment.author = jsonDictionary[@"author"][@"name"];
// Email might be `false`, turn into `nil`
comment.authorEmail = [jsonDictionary[@"author"] stringForKey:@"email"];
Expand Down
1 change: 1 addition & 0 deletions WordPressKit/RemoteComment.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

@interface RemoteComment : NSObject
@property (nonatomic, strong) NSNumber *commentID;
@property (nonatomic, strong) NSNumber *authorID;
@property (nonatomic, strong) NSString *author;
@property (nonatomic, strong) NSString *authorEmail;
@property (nonatomic, strong) NSString *authorUrl;
Expand Down
1 change: 1 addition & 0 deletions WordPressKit/RemoteReaderPost.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
@property (nonatomic) BOOL receivesCommentNotifications;

// Base Post Model
@property (nonatomic, strong) NSNumber *authorID;
@property (nonatomic, strong) NSString *author;
@property (nonatomic, strong) NSString *content;
@property (nonatomic, strong) NSString *date_created_gmt;
Expand Down
1 change: 1 addition & 0 deletions WordPressKit/RemoteReaderPost.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ - (instancetype)initWithDictionary:(NSDictionary *)dict;
NSDictionary *authorDict = [dict dictionaryForKey:PostRESTKeyAuthor];
NSDictionary *discussionDict = [dict dictionaryForKey:PostRESTKeyDiscussion] ?: dict;

self.authorID = [authorDict numberForKey:PostRESTKeyID];
self.author = [self stringOrEmptyString:[authorDict stringForKey:PostRESTKeyNiceName]]; // typically the author's screen name
self.authorAvatarURL = [self stringOrEmptyString:[authorDict stringForKey:PostRESTKeyAvatarURL]];
self.authorDisplayName = [[self stringOrEmptyString:[authorDict stringForKey:PostRESTKeyName]] stringByDecodingXMLCharacters]; // Typically the author's given name
Expand Down
1 change: 1 addition & 0 deletions WordPressKitTests/CommentServiceRemoteRESTTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ final class CommentServiceRemoteRESTTests: RemoteTestCase, RESTTestable {
return
}

XCTAssertEqual(comment.authorID, NSNumber(value: 12345))
XCTAssertEqual(comment.author, "Comment Author")
XCTAssertEqual(comment.authorEmail, "author@email.com")
XCTAssertEqual(comment.authorUrl, "author URL")
Expand Down
2 changes: 1 addition & 1 deletion WordPressKitTests/Mock Data/site-comments-success.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"link": "post URL"
},
"author": {
"ID": 0,
"ID": 12345,
"login": "",
"email": "author@email.com",
"name": "Comment Author",
Expand Down