cannot set media post id...
This commit is contained in:
parent
d78066b90a
commit
d5b38ea3ed
|
@ -84,14 +84,15 @@ const migrate = async (node, resource) => {
|
|||
console.error(`failed to create "${url}" due to error: ${e.message}`);
|
||||
}
|
||||
|
||||
await Promise.all(mediaIds.map(async (mediaId) => {
|
||||
if (mediaId) wp.media().id(mediaId).update({
|
||||
post: id,
|
||||
date_gmt: new Date(node.publishedAt)
|
||||
});
|
||||
})).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
// what's up with setting media to posts? the below snippet yields 'invalid parameter(s): post'...
|
||||
// await Promise.all(mediaIds.map(async (mediaId) => {
|
||||
// if (mediaId) wp.media().id(mediaId).update({
|
||||
// post: id,
|
||||
// date_gmt: new Date(node.publishedAt)
|
||||
// });
|
||||
// })).catch((error) => {
|
||||
// console.error(error);
|
||||
// });
|
||||
}
|
||||
|
||||
const download = async (location) => {
|
||||
|
|
Loading…
Reference in New Issue