bp_core_create_root_component_page()

Create WordPress pages to be used as BP component directories.

Description

Source

File: bp-core/bp-core-functions.php

921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
function bp_core_create_root_component_page() {
 
    // Get BuddyPress.
    $bp = buddypress();
 
    $new_page_ids = array();
 
    foreach ( (array) $bp->add_root as $slug ) {
        $new_page_ids[ $slug ] = wp_insert_post( array(
            'comment_status' => 'closed',
            'ping_status'    => 'closed',
            'post_title'     => ucwords( $slug ),
            'post_status'    => 'publish',
            'post_type'      => 'page'
        ) );
    }
 
    $page_ids = array_merge( $new_page_ids, bp_core_get_directory_page_ids( 'all' ) );
    bp_core_update_directory_page_ids( $page_ids );
}

Changelog

Changelog
Version Description
BuddyPress 1.5.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.