From 1a352d56f916a3a77c3d1e4ef5584741e323c056 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 15 Sep 2015 17:10:24 +0000 Subject: [PATCH] Implement `wp_login_url()` and `wp_registration_url()` in places where `wp-login.php` is currently hard-coded. See #31495 Props GregLone git-svn-id: https://develop.svn.wordpress.org/trunk@34213 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-activate.php | 2 +- src/wp-admin/includes/network.php | 2 +- src/wp-includes/canonical.php | 4 ++-- src/wp-includes/general-template.php | 2 +- src/wp-login.php | 4 ++-- src/wp-signup.php | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/wp-activate.php b/src/wp-activate.php index 7b7ef3498c..0fb0eaecf8 100644 --- a/src/wp-activate.php +++ b/src/wp-activate.php @@ -14,7 +14,7 @@ require( dirname(__FILE__) . '/wp-load.php' ); require( dirname( __FILE__ ) . '/wp-blog-header.php' ); if ( !is_multisite() ) { - wp_redirect( site_url( '/wp-login.php?action=register' ) ); + wp_redirect( wp_registration_url() ); die(); } diff --git a/src/wp-admin/includes/network.php b/src/wp-admin/includes/network.php index b47d831656..13004494f7 100644 --- a/src/wp-admin/includes/network.php +++ b/src/wp-admin/includes/network.php @@ -494,7 +494,7 @@ EOF; -

+

+
' . $login_form_top . '

' . __('Register For This Site') . '

', $errors); ?> - +

@@ -908,7 +908,7 @@ default: } ?> - +

diff --git a/src/wp-signup.php b/src/wp-signup.php index 2729132099..fa88ba9e8d 100644 --- a/src/wp-signup.php +++ b/src/wp-signup.php @@ -28,7 +28,7 @@ function do_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(); } @@ -669,7 +669,7 @@ $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' ) ) ); + $login_url = wp_login_url( network_site_url( 'wp-signup.php' ) ); echo sprintf( __( 'You must first log in, and then you can create a new site.' ), $login_url ); } else { $stage = isset( $_POST['stage'] ) ? $_POST['stage'] : 'default';