Skip to content

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

Description

@ygweric

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 );
})

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions