as I can insert my php post using the format of a post ( example : post -format- quote ) using wp_insert_post ().
$my_post = array(
'post_type' => 'post', // "post" para una entrada, "page" para páginas, "libro" para el custom post type libro...
'post_status' => 'publish', // "draft" para borrador, "future" para programarlo...
'post_title' => $_POST['BlogEntranceTitle'],
'post_content' => $_POST['BlogEntranceCode'],
'post_author' => $user_ID, //
'post_category' => $_POST['BlogEntranceCats'],
'tags_input' => $_POST['BlogEntranceTags'],
'post_excerpt' => $_POST['BlogEntranceExcerpt']
);
wp_insert_post( $my_post );
achievement insert these options but I get no add format post
For completeness: there is no need to 'decouple' or have this as a separate operation, as it can be set in the same array with the remaining settings. There is an option (namely, 'tax_input') to set taxonomies directly in the array containing the post parameters.
This is what I use to achieve the same effect:
You need to update post format separately because Post Format is a type of taxonomy. See following example for updating post format.
After inserting Post, Post ID is returned. That ID is used to update the post format. In the above example,
Image
post format will be assigned. Please change it as per your requirement.