wp_install_maybe_enable_pretty_permalinks example

$user = new WP_User( $user_id );
        $user->set_role( 'administrator' );

        if ( $user_created ) {
            $user->user_url = $guessurl;
            wp_update_user( $user );
        }

        wp_install_defaults( $user_id );

        wp_install_maybe_enable_pretty_permalinks();

        flush_rewrite_rules();

        wp_new_blog_notification( $blog_title$guessurl$user_id( $email_password ? $user_password : __( 'The password you chose during installation.' ) ) );

        wp_cache_flush();

        /** * Fires after a site is fully installed. * * @since 3.9.0 * * @param WP_User $user The site owner. */
Home | Imprint | This part of the site doesn't use cookies.