Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wpb_create_my_pages($blog_id, $user_id){
- switch_to_blog($blog_id);
- // create new page
- $page_id = wp_insert_post(array(
- 'post_title' => 'PAGE TITLE',
- 'post_name' => 'PAGE-NAME',
- 'post_content' => 'CONTENT OF THE PAGE.',
- 'post_status' => 'publish',
- 'post_author' => $user_id, // or "1" (super-admin?)
- 'post_type' => 'page',
- 'menu_order' => 1,
- 'comment_status' => 'closed',
- 'ping_status' => 'closed',
- ));
- // Find and delete the WP default Sample Page
- $defaultPage = get_page_by_title( 'Sample Page' );
- wp_delete_post( $defaultPage->ID );
- restore_current_blog();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement