Hi @timm
I believe that’s because the new_post
attributes have the wrong values. Could you please debug them like the following?
echo "POST['type']:\n";
var_dump($_POST['type']);
echo "\npost_status:\n";
var_dump($post_status);
Also, could you please set them manually like this:
'new_post' => array(
'post_type' => 'book',
'post_status' => 'published'
),
Thanks 🙂