Reply To: [Resolved] Create users Pages
Hi @bloodslayer
wp_insert_post() is a function provided by WordPress which lets developers add pages to the database without the need to access the WP admin area.
So, as an example, you could use it like this:
$post = array(
'post_content' => 'This is some content',
'post_name' => 'this-is-the-page-slug',
'post_title' => 'I am the title of this page',
'post_status' => 'publish',
'post_type' => 'page',
'post_excerpt' => 'This is the excerpt'
);
$post_id = wp_insert_post( $post );
Notes: $post_id will be the ID of the new page or if wp_insert_post() failed (for whatever reason) it will be 0.
So that’s how you create a new page programmatically. It’s more of a WordPress thing than a BuddyPress thing.