// Convert taxonomy input to term IDs, to avoid ambiguity.
if ( isset( $post_data['tax_input'
] ) ) { foreach ( (array) $post_data['tax_input'
] as $taxonomy =>
$terms ) { $tax_object =
get_taxonomy( $taxonomy );
if ( $tax_object &&
isset( $tax_object->meta_box_sanitize_cb
) ) { $translated['tax_input'
][ $taxonomy ] =
call_user_func_array( $tax_object->meta_box_sanitize_cb, array
( $taxonomy,
$terms ) );
} } } add_meta( $post_id );
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 ] ) ) {