WordPress fügen Sie neue Seite programmatisch hinzu

$new_page = array(
    'comment_status' => 'close',
    'ping_status' => 'close',
    'post_author' => $user_ID,
    'post_title' => ucwords('title_of_the_page'),
    'post_name' => strtolower(str_replace(' ', '-', trim('title_of_the_page'))),
    'post_status' => 'publish',
    'post_content' => 'Content of the page',
    'post_type' => 'page',
    'post_parent' => 'id_of_the_parent_page_if_it_available'
);
$post_id = wp_insert_post($new_page);
Ivan Cuaco