populate_roles example

'blog_public' => (int) $site->public,
                'WPLANG'      => get_network_option( $network->id, 'WPLANG' ),
            ),
            $args['options']
        )
    );

    // Clean blog cache after populating options.     clean_blog_cache( $site );

    // Populate the site's roles.     populate_roles();
    $wp_roles = new WP_Roles();

    // Populate metadata for the site.     populate_site_meta( $site->id, $args['meta'] );

    // Remove all permissions that may exist for the site.     $table_prefix = $wpdb->get_blog_prefix();
    delete_metadata( 'user', 0, $table_prefix . 'user_level', null, true );   // Delete all.     delete_metadata( 'user', 0, $table_prefix . 'capabilities', null, true ); // Delete all.
    // Install default site content.

    function wp_install( $blog_title$user_name$user_email$is_public$deprecated = '', $user_password = '', $language = '' ) {
        if ( ! empty( $deprecated ) ) {
            _deprecated_argument( __FUNCTION__, '2.6.0' );
        }

        wp_check_mysql_version();
        wp_cache_flush();
        make_db_current_silent();
        populate_options();
        populate_roles();

        update_option( 'blogname', $blog_title );
        update_option( 'admin_email', $user_email );
        update_option( 'blog_public', $is_public );

        // Freshness of site - in the future, this could get more specific about actions taken, perhaps.         update_option( 'fresh_site', 1 );

        if ( $language ) {
            update_option( 'WPLANG', $language );
        }

        
$suppress = $wpdb->suppress_errors();
    if ( $wpdb->get_results( "DESCRIBE {$wpdb->posts}) ) {
        die( '<h1>' . __( 'Already Installed' ) . '</h1><p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p></body></html>' );
    }
    $wpdb->suppress_errors( $suppress );

    $url = get_blogaddress_by_id( $blog_id );

    // Set everything up.     make_db_current_silent( 'blog' );
    populate_options();
    populate_roles();

    // populate_roles() clears previous role definitions so we start over.     $wp_roles = new WP_Roles();

    $siteurl = $home = untrailingslashit( $url );

    if ( ! is_subdomain_install() ) {

        if ( 'https' === parse_url( get_site_option( 'siteurl' ), PHP_URL_SCHEME ) ) {
            $siteurl = set_url_scheme( $siteurl, 'https' );
        }
        
Home | Imprint | This part of the site doesn't use cookies.