Open stevejburge opened 3 years ago
@stevejburge
if a post is scheduled to be published at a future time and you have it set to expire, the expiration date/time is cleared when the post is published meaning that the post never expires.
I cannot replicate this. The expiration date and all associate post meta is not cleared when a scheduled post is published.
is that we've also noticed that when a post expires the expiration date is also removed
Cannot replicate this either. The expiration date and all associate post meta is not cleared when a post expires.
@contactashish13 I can replicate this issue, on a local multisite installation (running a wamp environment) with al plugins at latest version. The "postexpirator_update_post_meta" is fired when a scheduled post gets published. This will start "postexpirator_unschedule_event". I've enabled debugging and can confirm that this is the sequense of events.
@gjbrendeke thanks! Can you confirm that this only happens in a multisite?
@contactashish13 Hi, for what it's worth: I've created a clean (Vagrant/VCCW based) single WordPress installation. Nothing installed, except the "Post Expirator" plugin. In this environment the expiration date/time is not removed when the post gets published.
@contactashish13 Whow, after installing the "Classic Editor" plugin the scheduled date gets deleted when a post is Published. Don't understand the code logic yet, but when using the Gutenberg blcok editor, the postexpirator_update_post_meta (hich is hooked to the save_post action) will exit due to this code: // we want to make sure we don't fire the save_post action when we are inside the block editor // but this should not stop quick/bulk edit if ( PostExpirator_Util::is_gutenberg_active() && PostExpirator_Facade::show_gutenberg_metabox() && ! isset( $_POST['expirationdate_quickedit'] ) && ! isset( $_POST['expirationdate_formcheck'] ) ) { return; } Obviously, using "classic editor" this " return" statement is not triggerd.
Solved it on my production systems: make it two seperate code blocks, one to test the "gutenberg" condition and another to test the quickedit/formcheck condition.
This one may require some careful thought:
https://wordpress.org/support/topic/scheduled-posts-remove-expiry-date-time-when-published/