Preview:
$post_id = wp_insert_post(array (
   'post_type' => 'your_post_type',
   'post_title' => $your_title,
   'post_content' => $your_content,
   'post_status' => 'publish',
   'comment_status' => 'closed',
   'ping_status' => 'closed',
   'meta_input' => array(
      '_your_custom_1' => $custom_1,
      '_your_custom_2' => $custom_2,
      '_your_custom_3' => $custom_3,
    ),
));
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter