node-wpapi
node-wpapi copied to clipboard
Changing post_type
I would like to create a post with wp.posts().create() and assign it the correct post_type, however this does not seem to work with the post_type key. Either using create() or update() doesn't change that value.
That code leads to a post that has the post_type of post and not wprm_recipe. How could I change that value?
const firstPost = await wp.posts().create({
title: title,
content: summary,
status: 'draft',
comment_status: 'closed',
ping_status: 'closed',
slug: slug,
post_type: 'wprm_recipe'
});