Make WordPress Core

Changeset 34213


Ignore:
Timestamp:
09/15/2015 05:10:24 PM (9 years ago)
Author:
johnbillion
Message:

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

See #31495
Props GregLone

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-activate.php

    r34162 r34213  
    1515
    1616if ( !is_multisite() ) {
    17     wp_redirect( site_url( '/wp-login.php?action=register' ) );
     17    wp_redirect( wp_registration_url() );
    1818    die();
    1919}
  • trunk/src/wp-admin/includes/network.php

    r34023 r34213  
    495495
    496496    if ( !is_multisite() ) { ?>
    497         <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>
     497        <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>
    498498<?php
    499499    }
  • trunk/src/wp-includes/canonical.php

    r33775 r34213  
    327327                $redirect_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) );
    328328            } else {
    329                 $redirect_url = site_url( 'wp-login.php?action=register' );
     329                $redirect_url = wp_registration_url();
    330330            }
    331331
     
    592592    );
    593593    if ( in_array( untrailingslashit( $_SERVER['REQUEST_URI'] ), $logins ) ) {
    594         wp_redirect( site_url( 'wp-login.php', 'login' ) );
     594        wp_redirect( wp_login_url() );
    595595        exit;
    596596    }
  • trunk/src/wp-includes/general-template.php

    r33929 r34213  
    448448
    449449    $form = '
    450         <form name="' . $args['form_id'] . '" id="' . $args['form_id'] . '" action="' . esc_url( site_url( 'wp-login.php', 'login_post' ) ) . '" method="post">
     450        <form name="' . $args['form_id'] . '" id="' . $args['form_id'] . '" action="' . esc_url( wp_login_url() ) . '" method="post">
    451451            ' . $login_form_top . '
    452452            <p class="login-username">
  • trunk/src/wp-login.php

    r33924 r34213  
    743743?>
    744744
    745 <form name="registerform" id="registerform" action="<?php echo esc_url( site_url('wp-login.php?action=register', 'login_post') ); ?>" method="post" novalidate="novalidate">
     745<form name="registerform" id="registerform" action="<?php echo esc_url( wp_registration_url() ); ?>" method="post" novalidate="novalidate">
    746746    <p>
    747747        <label for="user_login"><?php _e('Username') ?><br />
     
    909909?>
    910910
    911 <form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post">
     911<form name="loginform" id="loginform" action="<?php echo esc_url( wp_login_url() ); ?>" method="post">
    912912    <p>
    913913        <label for="user_login"><?php _e('Username') ?><br />
  • trunk/src/wp-signup.php

    r34162 r34213  
    2929
    3030if ( !is_multisite() ) {
    31     wp_redirect( site_url('wp-login.php?action=register') );
     31    wp_redirect( wp_registration_url() );
    3232    die();
    3333}
     
    670670    _e( 'Registration has been disabled.' );
    671671} elseif ( $active_signup == 'blog' && !is_user_logged_in() ) {
    672     $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode( network_site_url( 'wp-signup.php' ) ) );
     672    $login_url = wp_login_url( network_site_url( 'wp-signup.php' ) );
    673673    echo sprintf( __( 'You must first <a href="%s">log in</a>, and then you can create a new site.' ), $login_url );
    674674} else {
Note: See TracChangeset for help on using the changeset viewer.