How can I set the time on a new post to 8am using an action hook?
-
Is it possible to set automatically set the time to 8am on a new post in the Block editor using PHP and a action hook? I write batches of scheduled posts and want each to have the publication time of 8am. That way, all I need to do is set the day and save the draft.
I tried jQuery in the Block editor https://www.ads-software.com/support/topic/using-jquery-with-the-block-editor/ But there are problems interacting with React, detecting when the new post has post-new.php in the URL, and setting a cookie to prevent the time changer from running more than once.
I suspect a function would use
https://developer.www.ads-software.com/reference/hooks/wp_insert_post/
to set the time and AM/PM, and to fire only when a new post is created.Is there an action hook for the time and the AM/PM selector in the Block Editor?
I’d appreciate any ideas.
Or would I need to update the database column to set the publication time?
- You must be logged in to reply to this topic.