Implement `wp_login_url()` and `wp_registration_url()` in places where `wp-login.php` is currently hard-coded.

See #31495
Props GregLone

Built from https://develop.svn.wordpress.org/trunk@34213


git-svn-id: http://core.svn.wordpress.org/trunk@34177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2015-09-15 17:11:35 +00:00
parent f5edeb11d0
commit a9e5cfddc7
7 changed files with 10 additions and 10 deletions

View File

@ -14,7 +14,7 @@ require( dirname(__FILE__) . '/wp-load.php' );
require( dirname( __FILE__ ) . '/wp-blog-header.php' ); require( dirname( __FILE__ ) . '/wp-blog-header.php' );
if ( !is_multisite() ) { if ( !is_multisite() ) {
wp_redirect( site_url( '/wp-login.php?action=register' ) ); wp_redirect( wp_registration_url() );
die(); die();
} }

View File

@ -494,7 +494,7 @@ EOF;
<?php endif; // end IIS/Apache code branches. <?php endif; // end IIS/Apache code branches.
if ( !is_multisite() ) { ?> if ( !is_multisite() ) { ?>
<p><?php _e( 'Once you complete these steps, your network is enabled and configured. You will have to log in again.' ); ?> <a href="<?php echo esc_url( site_url( 'wp-login.php' ) ); ?>"><?php _e( 'Log In' ); ?></a></p> <p><?php _e( 'Once you complete these steps, your network is enabled and configured. You will have to log in again.' ); ?> <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log In' ); ?></a></p>
<?php <?php
} }
} }

View File

@ -326,7 +326,7 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
/** This filter is documented in wp-login.php */ /** This filter is documented in wp-login.php */
$redirect_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ); $redirect_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) );
} else { } else {
$redirect_url = site_url( 'wp-login.php?action=register' ); $redirect_url = wp_registration_url();
} }
wp_redirect( $redirect_url, 301 ); wp_redirect( $redirect_url, 301 );
@ -591,7 +591,7 @@ function wp_redirect_admin_locations() {
site_url( 'login', 'relative' ), site_url( 'login', 'relative' ),
); );
if ( in_array( untrailingslashit( $_SERVER['REQUEST_URI'] ), $logins ) ) { if ( in_array( untrailingslashit( $_SERVER['REQUEST_URI'] ), $logins ) ) {
wp_redirect( site_url( 'wp-login.php', 'login' ) ); wp_redirect( wp_login_url() );
exit; exit;
} }
} }

View File

@ -447,7 +447,7 @@ function wp_login_form( $args = array() ) {
$login_form_bottom = apply_filters( 'login_form_bottom', '', $args ); $login_form_bottom = apply_filters( 'login_form_bottom', '', $args );
$form = ' $form = '
<form name="' . $args['form_id'] . '" id="' . $args['form_id'] . '" action="' . esc_url( site_url( 'wp-login.php', 'login_post' ) ) . '" method="post"> <form name="' . $args['form_id'] . '" id="' . $args['form_id'] . '" action="' . esc_url( wp_login_url() ) . '" method="post">
' . $login_form_top . ' ' . $login_form_top . '
<p class="login-username"> <p class="login-username">
<label for="' . esc_attr( $args['id_username'] ) . '">' . esc_html( $args['label_username'] ) . '</label> <label for="' . esc_attr( $args['id_username'] ) . '">' . esc_html( $args['label_username'] ) . '</label>

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.4-alpha-34212'; $wp_version = '4.4-alpha-34213';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -742,7 +742,7 @@ case 'register' :
login_header(__('Registration Form'), '<p class="message register">' . __('Register For This Site') . '</p>', $errors); login_header(__('Registration Form'), '<p class="message register">' . __('Register For This Site') . '</p>', $errors);
?> ?>
<form name="registerform" id="registerform" action="<?php echo esc_url( site_url('wp-login.php?action=register', 'login_post') ); ?>" method="post" novalidate="novalidate"> <form name="registerform" id="registerform" action="<?php echo esc_url( wp_registration_url() ); ?>" method="post" novalidate="novalidate">
<p> <p>
<label for="user_login"><?php _e('Username') ?><br /> <label for="user_login"><?php _e('Username') ?><br />
<input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr(wp_unslash($user_login)); ?>" size="20" /></label> <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr(wp_unslash($user_login)); ?>" size="20" /></label>
@ -908,7 +908,7 @@ default:
} }
?> ?>
<form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post"> <form name="loginform" id="loginform" action="<?php echo esc_url( wp_login_url() ); ?>" method="post">
<p> <p>
<label for="user_login"><?php _e('Username') ?><br /> <label for="user_login"><?php _e('Username') ?><br />
<input type="text" name="log" id="user_login"<?php echo $aria_describedby_error; ?> class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" /></label> <input type="text" name="log" id="user_login"<?php echo $aria_describedby_error; ?> class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" /></label>

View File

@ -28,7 +28,7 @@ function do_signup_header() {
add_action( 'wp_head', 'do_signup_header' ); add_action( 'wp_head', 'do_signup_header' );
if ( !is_multisite() ) { if ( !is_multisite() ) {
wp_redirect( site_url('wp-login.php?action=register') ); wp_redirect( wp_registration_url() );
die(); die();
} }
@ -669,7 +669,7 @@ $current_user = wp_get_current_user();
if ( $active_signup == 'none' ) { if ( $active_signup == 'none' ) {
_e( 'Registration has been disabled.' ); _e( 'Registration has been disabled.' );
} elseif ( $active_signup == 'blog' && !is_user_logged_in() ) { } 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 <a href="%s">log in</a>, and then you can create a new site.' ), $login_url ); echo sprintf( __( 'You must first <a href="%s">log in</a>, and then you can create a new site.' ), $login_url );
} else { } else {
$stage = isset( $_POST['stage'] ) ? $_POST['stage'] : 'default'; $stage = isset( $_POST['stage'] ) ? $_POST['stage'] : 'default';