X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/11be15bd505d66a91e2c80062190b13e315a04a9..ef91a7f4f3c6468973e192335a27ec0e0faca0b5:/wp-signup.php diff --git a/wp-signup.php b/wp-signup.php index 9dd2c3da..6cf96b5c 100644 --- a/wp-signup.php +++ b/wp-signup.php @@ -5,9 +5,9 @@ require( dirname(__FILE__) . '/wp-load.php' ); add_action( 'wp_head', 'wp_no_robots' ); -require( './wp-blog-header.php' ); +require( dirname( __FILE__ ) . '/wp-blog-header.php' ); -if ( is_array( get_site_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) == true ) { +if ( is_array( get_site_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) ) { wp_redirect( network_home_url() ); die(); } @@ -18,12 +18,17 @@ if ( is_array( get_site_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) && * @since MU */ function do_signup_header() { + /** + * Fires within the head section of the site sign-up screen. + * + * @since 3.0.0 + */ do_action( 'signup_header' ); } add_action( 'wp_head', 'do_signup_header' ); if ( !is_multisite() ) { - wp_redirect( site_url('wp-login.php?action=register') ); + wp_redirect( wp_registration_url() ); die(); } @@ -35,6 +40,13 @@ if ( !is_main_site() ) { // Fix for page title $wp_query->is_404 = false; +/** + * Fires before the Site Signup page is loaded. + * + * @since 4.4.0 + */ +do_action( 'before_signup_header' ); + /** * Prints styles for front-end Multisite signup pages * @@ -51,6 +63,7 @@ function wpmu_signup_stylesheet() { .mu_register #user_email, .mu_register #blogname, .mu_register #user_name { width:100%; font-size: 24px; margin:5px 0; } + .mu_register #site-language { display: block; } .mu_register .prefix_address, .mu_register .suffix_address {font-size: 18px;display:inline; } .mu_register label { font-weight:700; font-size:15px; display:block; margin:10px 0; } @@ -61,24 +74,33 @@ function wpmu_signup_stylesheet() { } add_action( 'wp_head', 'wpmu_signup_stylesheet' ); -get_header(); +get_header( 'wp-signup' ); +/** + * Fires before the site sign-up form. + * + * @since 3.0.0 + */ do_action( 'before_signup_form' ); ?> -
-
+
+'; +} $newblogname = isset($_GET['new']) ? strtolower(preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'])) : null; @@ -532,8 +833,9 @@ $current_user = wp_get_current_user(); if ( $active_signup == 'none' ) { _e( 'Registration has been disabled.' ); } elseif ( $active_signup == 'blog' && !is_user_logged_in() ) { - $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode( network_site_url( 'wp-signup.php' ) ) ); - echo sprintf( __( 'You must first log in, and then you can create a new site.' ), $login_url ); + $login_url = wp_login_url( network_site_url( 'wp-signup.php' ) ); + /* translators: %s: login URL */ + printf( __( 'You must first log in, and then you can create a new site.' ), $login_url ); } else { $stage = isset( $_POST['stage'] ) ? $_POST['stage'] : 'default'; switch ( $stage ) { @@ -555,12 +857,17 @@ if ( $active_signup == 'none' ) { case 'default': default : $user_email = isset( $_POST[ 'user_email' ] ) ? $_POST[ 'user_email' ] : ''; - do_action( 'preprocess_signup_form' ); // populate the form from invites, elsewhere? + /** + * Fires when the site sign-up form is sent. + * + * @since 3.0.0 + */ + do_action( 'preprocess_signup_form' ); if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) ) signup_another_blog($newblogname); - elseif ( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) ) + elseif ( ! is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'user' ) ) signup_user( $newblogname, $user_email ); - elseif ( is_user_logged_in() == false && ( $active_signup == 'blog' ) ) + elseif ( ! is_user_logged_in() && ( $active_signup == 'blog' ) ) _e( 'Sorry, new registrations are not allowed at this time.' ); else _e( 'You are logged in already. No need to register again!' ); @@ -569,9 +876,15 @@ if ( $active_signup == 'none' ) { $newblog = get_blogaddress_by_name( $newblogname ); if ( $active_signup == 'blog' || $active_signup == 'all' ) - printf( '

' . __( 'The site you were looking for, %s, does not exist, but you can create it now!' ) . '

', $newblog ); + /* translators: %s: site address */ + printf( '

' . __( 'The site you were looking for, %s, does not exist, but you can create it now!' ) . '

', + '' . $newblog . '' + ); else - printf( '

' . __( 'The site you were looking for, %s, does not exist.' ) . '

', $newblog ); + /* translators: %s: site address */ + printf( '

' . __( 'The site you were looking for, %s, does not exist.' ) . '

', + '' . $newblog . '' + ); } break; } @@ -579,6 +892,12 @@ if ( $active_signup == 'none' ) { ?>
- + - +