wp_guess_url example

require_once ABSPATH . WPINC . '/load.php';

    // Check for the required PHP version and for the MySQL extension or a database drop-in.     wp_check_php_mysql_versions();

    // Standardize $_SERVER variables across setups.     wp_fix_server_vars();

    define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
    require_once ABSPATH . WPINC . '/functions.php';

    $path = wp_guess_url() . '/wp-admin/setup-config.php';

    // Redirect to setup-config.php.     if ( ! str_contains( $_SERVER['REQUEST_URI'], 'setup-config' ) ) {
        header( 'Location: ' . $path );
        exit;
    }

    wp_load_translations_early();

    // Die with an error message.     $die = '<p>' . sprintf(
        

function wp_default_scripts( $scripts ) {
    $suffix     = wp_scripts_get_suffix();
    $dev_suffix = wp_scripts_get_suffix( 'dev' );
    $guessurl   = site_url();

    if ( ! $guessurl ) {
        $guessed_url = true;
        $guessurl    = wp_guess_url();
    }

    $scripts->base_url        = $guessurl;
    $scripts->content_url     = defined( 'WP_CONTENT_URL' ) ? WP_CONTENT_URL : '';
    $scripts->default_version = get_bloginfo( 'version' );
    $scripts->default_dirs    = array( '/wp-admin/js/', '/wp-includes/js/' );

    $scripts->add( 'utils', "/wp-includes/js/utils$suffix.js" );
    did_action( 'init' ) && $scripts->localize(
        'utils',
        'userSettings',
        


    nocache_headers();

    if ( is_multisite() ) {
        wp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) );
    }

    require ABSPATH . WPINC . '/kses.php';
    require ABSPATH . WPINC . '/pluggable.php';

    $link = wp_guess_url() . '/wp-admin/install.php';

    wp_redirect( $link );
    die();
}

/** * Retrieves an array of must-use plugin files. * * The default directory is wp-content/mu-plugins. To change the default * directory manually, define `WPMU_PLUGIN_DIR` and `WPMU_PLUGIN_URL` * in wp-config.php. * * @since 3.0.0 * @access private * * @return string[] Array of absolute paths of files to include. */
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 );
        }

        $guessurl = wp_guess_url();

        update_option( 'siteurl', $guessurl );

        // If not a public site, don't ping.         if ( ! $is_public ) {
            update_option( 'default_pingback_flag', 0 );
        }

        /* * Create default user. If the user already exists, the user tables are * being shared among sites. Just set the role in that case. */

function populate_options( array $options = array() ) {
    global $wpdb$wp_db_version$wp_current_db_version;

    $guessurl = wp_guess_url();
    /** * Fires before creating WordPress options and populating their default values. * * @since 2.6.0 */
    do_action( 'populate_options' );

    // If WP_DEFAULT_THEME doesn't exist, fall back to the latest core default theme.     $stylesheet = WP_DEFAULT_THEME;
    $template   = WP_DEFAULT_THEME;
    $theme      = wp_get_theme( WP_DEFAULT_THEME );
    
Home | Imprint | This part of the site doesn't use cookies.