• Resolved thejokertm

    (@thejokertm)


    I was wondering if it is possible to schedule posts using the metadata attributes, I couldn’t get this to work, this is my YAML:


    title: Test pending
    taxonomy:
    category:
    – Blog
    post_tag:
    – pain
    – capitalism
    custom_fields:
    post_status: “future”
    post_date: “2022-08-27 18:00:00”

    Is this possible? If so, what am I doing wrong? Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author vaakash

    (@vaakash)

    Hi @thejokertm,

    Thanks for using GIW.

    What you have done should work. Behind the scenes, the plugin uses the wp_insert_post call to create a new post.

    I’ll check further on this and update you.

    Thanks,
    Aakash

    Thread Starter thejokertm

    (@thejokertm)

    Thank you!

    I tried to have these attributes under custom fields and to just have them under the title. In both cases the post was immediately published.

    Thread Starter thejokertm

    (@thejokertm)

    One more thing I just thought of, maybe the YAML isn’t getting parsed correctly? I was getting this error before:

    A YAML file cannot contain tabs as indentation at line 10 (near ” post_date: 2022-08-27 18:00:00″).

    So I removed the tabs and used white spaces to align the variables under “custom-fields”. Maybe this is related to the problem?

    Plugin Author vaakash

    (@vaakash)

    Hi @thejokertm,

    I looked at the code and scheduling post is not supported yet.
    Post date parameter is not recognized yet.

    I’ll add support for this in the next version of the plugin.

    Thanks,
    Aakash

    Thread Starter thejokertm

    (@thejokertm)

    Okay, got it.

    Is there any way to have a post be in the “draft” state by default?

    If I use the post_status variable to set my posts to draft when they upload, and then publish schedule them on WordPress, won’t they be set back to draft next time I pull changes?

    I’m trying to find a workflow how I can edit and update my posts using a markdown editor, but schedule them with WordPress without having to change the post_status variable in the YAML manually for every published post.

    Plugin Author vaakash

    (@vaakash)

    Hi @thejokertm,

    The plugin gives priority to the settings on the markdown file.

    So if the post was edited using WordPress admin, then upon pull from Github it will apply the change as in the markdown file since that is the source of truth.

    You can make changes to the markdown file and initiate a pull from the plugin.

    Once the feature to “schedule” posts is made available, I guess you would not need to change post status from drafts to publish.
    I understand the inconvienence, I’ll try to submit a fix in a couple of weeks.

    Thanks,
    Aakash

    Thread Starter thejokertm

    (@thejokertm)

    I understand, thank you. I will do it like this for now, and I look forward to the next update! 🙂

    Plugin Author vaakash

    (@vaakash)

    Hi @thejokertm,

    Post date support is added in version 1.5

    Please update to the new version.

    You can set the post date like below.
    post_date: 2022-11-29 09:23:16

    Thanks,
    Aakash

    Thread Starter thejokertm

    (@thejokertm)

    Hey Aakash, that’s amazing! Thank you!

    I have a question about the typical workflow for scheduling posts with this plugin.

    I set “post_status: future” and set the date using the “post_date” attribute.

    After the date has passed and the post is published, I have to go back to the source md file and manually set the post_status to published, right? Otherwise, next time I sync, it will unpublish the posts. Is the correct way of doing it?

    Plugin Author vaakash

    (@vaakash)

    Hi @thejokertm,

    I tested this and the post is marked published when the post status is future and the post date is past the current date.

    So there is no need to change the post status from future to published.

    Thanks,
    Aakash

    Thread Starter thejokertm

    (@thejokertm)

    That’s perfect, thank you so much Aakash!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Scheduling posts possible?’ is closed to new replies.