Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'post_updated', function( $post_ID, $post_after, $post_before ) use ( &$wpdb )
- {
- if(
- 'editing' === $post_after->post_status
- && ! in_array( $post_before->post_status, [ 'editing', 'publish' ] )
- && 'post' === $post_after->post_type
- )
- $wpdb->update(
- $wpdb->posts,
- [ 'post_date_gmt' => '0000-00-00 00:00:00' ],
- [ 'ID' => $post_ID ]
- );
- }, 10, 3 );
Add Comment
Please, Sign In to add comment