I manage a blog which consists of about 25 writers. Sometimes a few of them are in the process of writing a new post at once, and they end up publishing them too close to each other.
Is there a way to prevent this from happening? Something to say “Another post just went live within the last 5 minutes. You’ll need to wait 55 mins to publish yours.”
Here is a very rough block of code that should get you started. What it does is look for the most recent “future” or “publish” post and if that value is less than 1 hour different from the latest scheduled post, it schedules the current post to one hour plus the “most recent” time found.
This does in fact force the post scheduling, and if there is already a future post the next one will be scheduled after that already scheduled post. That means that it could potentially schedule posts far into the future.
You may want to exempt certain roles from this post scheduling, or require it only for a single role, just to help keep things manageable.
There is a plugin in the repository named Auto Future Date which does something like this. It hasn’t been updated for quite a while, but most of the code seems pretty useful.
I haven’t tested it, but the screenshots make it look like you can still directly publish the post and not stick to the
save_post
hook automatically. Making this code work with the right hooks should do the trick.