Reply To: Publish forum via php but it’s only visible after additional manual publish
Why does the forum only show up when I update it manually via backend?
Anyone any idea what this could be?
I’ve tried different roles; Moderator + Keymaster. Still getting the same result, everything does work – beside showing it in the frontend.Tho, after updating the forum within the backend it shows up in the frontend.
Thanks.
// Create FORUM Entry object
$my_forum = array(
'post_title' => 'title',
'post_content' => 'test',
'post_status' => 'private',
'post_author' => $_POST['post_author'], //also tried admin '1',
'post_type' => 'forum',
'post_parent' => '123' // parent forum
);
// Insert the post into the database
$page_id = wp_insert_post( $my_forum );