} $post_data =
_wp_translate_postdata( true,
$post_data );
if ( is_wp_error( $post_data ) ) { wp_die( $post_data->
get_error_message() );
} $translated =
_wp_get_allowed_postdata( $post_data );
// Post formats.
if ( isset( $post_data['post_format'
] ) ) { set_post_format( $post_id,
$post_data['post_format'
] );
} $format_meta_urls = array
( 'url', 'link_url', 'quote_source_url'
);
foreach ( $format_meta_urls as $format_meta_url ) { $keyed = '_format_' .
$format_meta_url;
if ( isset( $post_data[ $keyed ] ) ) { update_post_meta( $post_id,
$keyed,
wp_slash( sanitize_url( wp_unslash( $post_data[ $keyed ] ) ) ) );
} } $format_keys = array
( 'quote', 'quote_source_name', 'image', 'gallery', 'audio_embed', 'video_embed'
);