Guest User

Untitled

a guest
Jun 29th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. add_action( 'post_updated', function( $post_ID, $post_after, $post_before ) use ( &$wpdb )
  2. {
  3. if(
  4. 'editing' === $post_after->post_status
  5. && ! in_array( $post_before->post_status, [ 'editing', 'publish' ] )
  6. && 'post' === $post_after->post_type
  7. )
  8. $wpdb->update(
  9. $wpdb->posts,
  10. [ 'post_date_gmt' => '0000-00-00 00:00:00' ],
  11. [ 'ID' => $post_ID ]
  12. );
  13.  
  14. }, 10, 3 );
Add Comment
Please, Sign In to add comment