Hi,
i am trying to create subpages via a function but the status is not set as expected.
This is my code, basically taken from the docs (creating pages from the frontend):
$entry = $entries->createChild([
'slug' => $slug,
'template' => 'entry',
'title' => $title,
'content' => $data,
'status' => 'listed'
]);
$entry->publish();
Without the last line (publish()) the page gets created as a draft. With the publish function i can bring it to “unlisted”. But i would expect it to be “listed” as stated in the createChild() parameters.
slug, title, content etc are all set correct.
What am i missing? Any help or hints much appreciated.