mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-06-05 15:09:59 +09:00
Merge pull request #4 from superted17/master
Adds undefined safety check to getPostCoverImageId
This commit is contained in:
@@ -199,6 +199,7 @@ function getPostId(post) {
|
||||
}
|
||||
|
||||
function getPostCoverImageId(post) {
|
||||
if (post.postmeta === undefined) return;
|
||||
let postmeta = post.postmeta.find(postmeta => postmeta.meta_key[0] === '_thumbnail_id');
|
||||
let id = postmeta ? postmeta.meta_value[0] : undefined;
|
||||
return id;
|
||||
|
||||
Reference in New Issue
Block a user