-
Notifications
You must be signed in to change notification settings - Fork 191
Closed
Description
I can't seem to add a post. I'm getting this error when I follow the example in the readme:
TypeError: wp.posts(...).create is not a function
Code:
wp.posts().create({
// "title" and "content" are the only required properties
title: 'Your Post Title',
content: 'Your post content',
// Post will be created as a draft by default if a specific "status"
// is not specified
status: 'publish'
}).then(function( response ) {
// "response" will hold all properties of your newly-created post,
// including the unique `id` the post was assigned on creation
console.log( response.id );
})
I also tried to change it to wp.posts().post which gives me this error:
Unhandled rejection Error: Unauthorized
Metadata
Metadata
Assignees
Labels
No labels