Moving wp_insert_post_data code from rewrite2 branch into master