update_post_meta( $post_id, '_edit_last',
get_current_user_id() );
$success =
wp_update_post( $translated );
// If the save failed, see if we can sanity check the main fields and try again.
if ( !
$success &&
is_callable( array
( $wpdb, 'strip_invalid_text_for_column'
) ) ) { $fields = array
( 'post_title', 'post_content', 'post_excerpt'
);
foreach ( $fields as $field ) { if ( isset( $translated[ $field ] ) ) { $translated[ $field ] =
$wpdb->
strip_invalid_text_for_column( $wpdb->posts,
$field,
$translated[ $field ] );
} } wp_update_post( $translated );
} // Now that we have an ID we can fix any attachment anchor hrefs.
_fix_attachment_links( $post_id );
wp_set_post_lock( $post_id );