network_site_url example


    do_action( 'signup_header' );
}
add_action( 'wp_head', 'do_signup_header' );

if ( ! is_multisite() ) {
    wp_redirect( wp_registration_url() );
    die();
}

if ( ! is_main_site() ) {
    wp_redirect( network_site_url( 'wp-signup.php' ) );
    die();
}

// Fix for page title. $wp_query->is_404 = false;

/** * Fires before the Site Sign-up page is loaded. * * @since 4.4.0 */

        $site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
    }

    $message = __( 'Someone has requested a password reset for the following account:' ) . "\r\n\r\n";
    /* translators: %s: Site name. */
    $message .= sprintf( __( 'Site Name: %s' )$site_name ) . "\r\n\r\n";
    /* translators: %s: User login. */
    $message .= sprintf( __( 'Username: %s' )$user_login ) . "\r\n\r\n";
    $message .= __( 'If this was a mistake, ignore this email and nothing will happen.' ) . "\r\n\r\n";
    $message .= __( 'To reset your password, visit the following address:' ) . "\r\n\r\n";
    $message .= network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user_login ), 'login' ) . '&wp_lang=' . $locale . "\r\n\r\n";

    if ( ! is_user_logged_in() ) {
        $requester_ip = $_SERVER['REMOTE_ADDR'];
        if ( $requester_ip ) {
            $message .= sprintf(
                /* translators: %s: IP address of password reset requester. */
                __( 'This password reset request originated from the IP address %s.' ),
                $requester_ip
            ) . "\r\n";
        }
    }

    
get_header( 'wp-activate' );

$blog_details = get_site();
?> <div id="signup-content" class="widecolumn"> <div class="wp-activate-container"> <?php if ( ! $key ) { ?> <h2><?php _e( 'Activation Key Required' ); ?></h2> <form name="activateform" id="activateform" method="post" action="<?php echo network_site_url( $blog_details->path . 'wp-activate.php' ); ?>"> <p> <label for="key"><?php _e( 'Activation Key:' ); ?></label> <br /><input type="text" name="key" id="key" value="" size="50" autofocus="autofocus" /> </p> <p class="submit"> <input id="submit" type="submit" name="Submit" class="submit" value="<?php esc_attr_e( 'Activate' ); ?>" /> </p> </form> <?php     } else {
        
$key = get_password_reset_key( $user );
        if ( is_wp_error( $key ) ) {
            return;
        }

        $switched_locale = switch_to_user_locale( $user_id );

        /* translators: %s: User login. */
        $message  = sprintf( __( 'Username: %s' )$user->user_login ) . "\r\n\r\n";
        $message .= __( 'To set your password, visit the following address:' ) . "\r\n\r\n";
        $message .= network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user->user_login ), 'login' ) . "\r\n\r\n";

        $message .= wp_login_url() . "\r\n";

        $wp_new_user_notification_email = array(
            'to'      => $user->user_email,
            /* translators: Login details notification email subject. %s: Site title. */
            'subject' => __( '[%s] Login Details' ),
            'message' => $message,
            'headers' => '',
        );

        
if ( ! empty( $redirect ) ) {
        $args['redirect_to'] = urlencode( $redirect );
    }

    if ( is_multisite() ) {
        $blog_details  = get_site();
        $wp_login_path = $blog_details->path . 'wp-login.php';
    } else {
        $wp_login_path = 'wp-login.php';
    }

    $lostpassword_url = add_query_arg( $argsnetwork_site_url( $wp_login_path, 'login' ) );

    /** * Filters the Lost Password URL. * * @since 2.8.0 * * @param string $lostpassword_url The lost password page URL. * @param string $redirect The path to redirect to on login. */
    return apply_filters( 'lostpassword_url', $lostpassword_url$redirect );
}

if ( method_exists( $wpdb, 'db_server_info' ) ) {
        $mysql_version = $wpdb->db_server_info();
    } elseif ( method_exists( $wpdb, 'db_version' ) ) {
        $mysql_version = preg_replace( '/[^0-9.].*/', '', $wpdb->db_version() );
    } else {
        $mysql_version = 'N/A';
    }

    if ( is_multisite() ) {
        $num_blogs         = get_blog_count();
        $wp_install        = network_site_url();
        $multisite_enabled = 1;
    } else {
        $multisite_enabled = 0;
        $num_blogs         = 1;
        $wp_install        = home_url( '/' );
    }

    $extensions = get_loaded_extensions();
    sort( $extensions, SORT_STRING | SORT_FLAG_CASE );
    $query = array(
        'version'            => $wp_version,
        

function network_admin_url( $path = '', $scheme = 'admin' ) {
    if ( ! is_multisite() ) {
        return admin_url( $path$scheme );
    }

    $url = network_site_url( 'wp-admin/network/', $scheme );

    if ( $path && is_string( $path ) ) {
        $url .= ltrim( $path, '/' );
    }

    /** * Filters the network admin URL. * * @since 3.0.0 * @since 5.8.0 The `$scheme` parameter was added. * * @param string $url The complete network admin URL including scheme and path. * @param string $path Path relative to the network admin URL. Blank string if * no path is specified. * @param string|null $scheme The scheme to use. Accepts 'http', 'https', * 'admin', or null. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). */

    if ( ! apply_filters( 'wpmu_signup_blog_notification', $domain$path$title$user_login$user_email$key$meta ) ) {
        return false;
    }

    // Send email with activation link.     if ( ! is_subdomain_install() || get_current_network_id() != 1 ) {
        $activate_url = network_site_url( "wp-activate.php?key=$key);
    } else {
        $activate_url = "http://{$domain}{$path}wp-activate.php?key=$key"; // @todo Use *_url() API.     }

    $activate_url = esc_url( $activate_url );

    $admin_email = get_site_option( 'admin_email' );

    if ( '' === $admin_email ) {
        $admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );
    }

    
<div class="wrap"> <h1 class="wp-heading-inline"> <?php echo esc_html( $title );
?> </h1> <?php if ( in_array( get_site_option( 'registration' ), array( 'all', 'blog' ), true ) ) {
    /** This filter is documented in wp-login.php */
    $sign_up_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) );
    printf( ' <a href="%s" class="page-title-action">%s</a>', esc_url( $sign_up_url )esc_html_x( 'Add New', 'site' ) );
}

if ( empty( $blogs ) ) :
    ?> <div class="notice notice-error is-dismissible"><p><strong><?php _e( 'You must be a member of at least one site to use this page.' ); ?></strong></p></div> <?php else :
    ?> <hr class="wp-header-end"> <form id="myblogs" method="post">
login_header( __( 'Lost Password' ), '<p class="message">' . __( 'Please enter your username or email address. You will receive an email message with instructions on how to reset your password.' ) . '</p>', $errors );

        $user_login = '';

        if ( isset( $_POST['user_login'] ) && is_string( $_POST['user_login'] ) ) {
            $user_login = wp_unslash( $_POST['user_login'] );
        }

        ?> <form name="lostpasswordform" id="lostpasswordform" action="<?php echo esc_url( network_site_url( 'wp-login.php?action=lostpassword', 'login_post' ) ); ?>" method="post"> <p> <label for="user_login"><?php _e( 'Username or Email Address' ); ?></label> <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" autocomplete="username" required="required" /> </p> <?php
            /** * Fires inside the lostpassword form tags, before the hidden fields. * * @since 2.1.0 */
            
if ( ! empty( $addl_path ) ) {
                $redirect['path'] = trailingslashit( $redirect['path'] ) . $addl_path;
            }

            $redirect_url = $redirect['scheme'] . '://' . $redirect['host'] . $redirect['path'];
        }

        if ( 'wp-register.php' === basename( $redirect['path'] ) ) {
            if ( is_multisite() ) {
                /** This filter is documented in wp-login.php */
                $redirect_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) );
            } else {
                $redirect_url = wp_registration_url();
            }

            wp_redirect( $redirect_url, 301 );
            die();
        }
    }

    $redirect['query'] = preg_replace( '#^\??&*?#', '', $redirect['query'] );

    
Home | Imprint | This part of the site doesn't use cookies.