Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create post with a date, AKA scheduled post #494

Open
ygweric opened this issue Dec 9, 2021 · 1 comment
Open

How to create post with a date, AKA scheduled post #494

ygweric opened this issue Dec 9, 2021 · 1 comment

Comments

@ygweric
Copy link

ygweric commented Dec 9, 2021

Can I do something like following code ?

wp.posts().create({
    title: 'Your Post Title',
    content: 'Your post content',
    date: new Date("2022-09-01")
    status: 'scheduled'
}).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 );
})
@BasToTheMax
Copy link

BasToTheMax commented Dec 21, 2021

I don't know, but you can always try :)
(I will test your code and see what happens)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants