We currently do a check to see if a task failed to create here:
|
$result = wp_insert_post( $post_data ); |
but it will never actually return a
WP_Error object, because the second param to
wp_insert_post() needs to be set to true.
https://developer.wordpress.org/reference/functions/wp_insert_post/