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

Commit 84a9a30

Browse files
committed
Merge branch 'develop' into issue/stats_timezone
2 parents 429191a + b70a073 commit 84a9a30

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

WordPressKit/DomainsServiceRemote.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class DomainsServiceRemote: ServiceRemoteWordPressComREST {
3939
case includeWordPressDotCom
4040
case onlyWordPressDotCom
4141
case wordPressDotComAndDotBlogSubdomains
42+
case whitelistedTopLevelDomains([String])
4243

4344
fileprivate func parameters() -> [String: AnyObject] {
4445
switch self {
@@ -54,6 +55,8 @@ public class DomainsServiceRemote: ServiceRemoteWordPressComREST {
5455
"vendor": "dot" as AnyObject,
5556
"only_wordpressdotcom": true as AnyObject,
5657
"include_wordpressdotcom": true as AnyObject]
58+
case .whitelistedTopLevelDomains(let whitelistedTLDs):
59+
return ["tlds": whitelistedTLDs.joined(separator: ",") as AnyObject]
5760
}
5861
}
5962
}

WordPressKit/PostServiceRemoteREST.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,9 @@ - (RemotePost *)remotePostFromJSONDictionary:(NSDictionary *)jsonPost {
438438
post.pathForDisplayImage = post.postThumbnailPath;
439439
} else {
440440
// parse contents for a suitable image
441-
if (!post.pathForDisplayImage) {
442-
post.pathForDisplayImage = [DisplayableImageHelper searchPostContentForImageToDisplay:post.content];
441+
post.pathForDisplayImage = [DisplayableImageHelper searchPostContentForImageToDisplay:post.content];
442+
if ([post.pathForDisplayImage length] == 0) {
443+
post.pathForDisplayImage = [DisplayableImageHelper searchPostAttachmentsForImageToDisplay:[jsonPost dictionaryForKey:@"attachments"] existingInContent:post.content];
443444
}
444445
}
445446

0 commit comments

Comments
 (0)