Skip to content

Commit

Permalink
fix: 修复 WordPress 摘要更新未生效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Aug 26, 2023
1 parent f761572 commit 65feeb2
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/adaptors/api/base/metaweblog/metaweblogBlogApiAdaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,18 @@ class MetaweblogBlogApiAdaptor extends BaseBlogApi {
})
}

if (!StrUtil.isEmptyString(post.mt_excerpt)) {
Object.assign(postObj, {
mt_excerpt: post.mt_excerpt,
})
}

if (!StrUtil.isEmptyString(post.mt_text_more)) {
Object.assign(postObj, {
mt_text_more: post.mt_text_more,
})
}

if (!StrUtil.isEmptyString(post.description)) {
Object.assign(postObj, {
description: post.description,
Expand Down Expand Up @@ -294,16 +306,6 @@ class MetaweblogBlogApiAdaptor extends BaseBlogApi {
}

return postObj
// return {
// title: post.title || '',
// mt_keywords: post.mt_keywords || '',
// description: post.description || '',
// wp_slug: post.wp_slug || '',
// dateCreated: post.dateCreated.toISOString() || new Date().toISOString(),
// categories: post.categories || [],
// post_status: post.post_status || POST_STATUS_CONSTANTS.POST_STATUS_PUBLISH,
// wp_password: post.wp_password || ''
// }
}
}

Expand Down

0 comments on commit 65feeb2

Please sign in to comment.