$post_information = array(
'post_title' => wp_strip_all_tags( $_POST['postTitle'] ),
'post_content' => wp_strip_all_tags( $_POST['postContent'] ),
'post_type' => 'works', // тип записи
'post_status' => 'publish', // нужный статус
);
$post_id = wp_insert_post( $post_information );
$post_id = wp_insert_post( $post_information );
if ( isset( $_POST['elements'] ) ) {
$images = $_POST['elements'];
$images = explode( ',', $images );
update_post_meta( $post_id, '_user_images', serialize( $images ) );
}
url: 'http://site.ru/wp-admin/admin-ajax.php',