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

Commit e533573

Browse files
committed
Check attachments for displayable image.
1 parent 0ce05a5 commit e533573

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

WordPressKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "WordPressKit"
3-
s.version = "4.2.0"
3+
s.version = "4.2.1-beta.1"
44
s.summary = "WordPressKit offers a clean and simple WordPress.com and WordPress.org API."
55

66
s.description = <<-DESC

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)