function fix_post_modified_ts($new_status, $old_status, $post) { global $wpdb; if ($new_status != 'inherit') { // Bail if we are creating a revision. $wpdb->update($wpdb->posts, array('post_modified' => $this->post['post_modified'], 'post_modified_gmt' => $this->post['post_modified_gmt']), array('ID' => $post->ID)); } }