imath / wp-statuses

WordPress plugin to ease Custom Post Statuses integration
GNU General Public License v2.0
160 stars 27 forks source link

Consider revising schedulked post handling #76

Closed shawfactor closed 1 year ago

shawfactor commented 1 year ago

Imath, Currently when a future date is selected as the publish date, the post status dropdown disappears

This is an annoying approach as users often want to leave future posts in draft or pending status until they are happy with them. Is it possible to revise this approach to something more user friendly? Pete

imath commented 1 year ago

This is specific to the classic editor right? If I remember well I've tried to mimic how WordPress was handling this at that time. I believe the problem might be in WordPress because future is a post status it's not just a date. I'll give another look to the Classic editor.

shawfactor commented 1 year ago

No it’s on the block editor, basically when a post date is in the future it automatically has a status of scheduled. This is not the ideal behaviour at all, see screenshot:

IMG_2648

shawfactor commented 1 year ago

Following up on this have you identified the underlying issue?

imath commented 1 year ago

@shawfactor Have you tried to click on the scheduled date to see if a modal box let you select "Immediately" to publish it right away?

shawfactor commented 1 year ago

The user interface works and I understand it. That is not the issue

the issue is that if you set a future date the status is automatically set to scheduled, when it should be possible to have future dated posts in draft or pending status.

This behaviour is not intuitive and is quite different to how the block editor works without wp-statuses.

imath commented 1 year ago

Just checked the behaviour of the Block Editor without WP Statuses. By default, when you schedule a post, its status is set to future into the db, when scheduled date is reached, the status becomes publish. The only difference is that you can edit the Visibility from the Block Editor to decide to protect by a password the post when the date is reached.

Can you tell me how you can schedule a post and have the future status switched to draft or pending when the date is reached in WordPress (meaning without any plugin altering this behaviour) ?

PS : see check_and_publish_future_post() https://github.com/WordPress/wordpress-develop/blob/6.3/src/wp-includes/post.php#L4943-L4965

shawfactor commented 1 year ago

When you use the editor natively a check box with pending review appears, this ensure the post is in pending if a future post date is set, please see screenshot IMG_2781

imath commented 1 year ago

@shawfactor Have you tried checking it then saving the post again? I did, the pending checkbox remains unchecked. The way the future status behaves is to be converted to a publish one once the date is reached. So to me showing this checkbox is useless.

shawfactor commented 1 year ago

Looks like you are right, I had someone complain about this behavior but it looks like its core that behaves illogically, which is a pain but certainly not a problem with this library (in fact your library is less confusing). This is the issue in core btw: https://github.com/WordPress/gutenberg/issues/12786

You can close this issue, its not valid

imath commented 1 year ago

Thanks for your feedback