Ticket #35177: 35177.patch
File 35177.patch, 2.8 KB (added by , 9 years ago) |
---|
-
general-template.php
260 260 } 261 261 262 262 /** 263 * Returns the URL that receives login and logout post data 264 * 265 * @since 4.4.1 266 * 267 * @param string $scheme URL scheme to use. 268 * @param bool $network Whether to use network_site_url instead of site_url 269 * @return string A URL. 270 */ 271 function wp_login_handler_url( $scheme = 'login' , $network = false ) { 272 $handler_url = $network === true ? network_site_url( 'wp-login.php', $scheme ) : site_url( 'wp-login.php', $scheme ); 273 274 /** 275 * Filter the login handler URL. 276 * 277 * @since 4.4.1 278 * 279 * @param string $handler_url The login handler URL. 280 * @param string $scheme URL scheme to use. 281 * @param bool $network Whether to use network_site_url instead of site_url 282 */ 283 return apply_filters( 'login_handler_url', $handler_url, $scheme, $network ); 284 } 285 286 /** 263 287 * Display the Log In/Out link. 264 288 * 265 289 * Displays a link, which allows users to navigate to the Log In page to log in … … 308 332 $args['redirect_to'] = urlencode( $redirect ); 309 333 } 310 334 311 $logout_url = add_query_arg($args, site_url('wp-login.php', 'login'));335 $logout_url = add_query_arg($args, wp_login_handler_url() ); 312 336 $logout_url = wp_nonce_url( $logout_url, 'log-out' ); 313 337 314 338 /** … … 332 356 * @return string A log in URL. 333 357 */ 334 358 function wp_login_url($redirect = '', $force_reauth = false) { 335 $login_url = site_url('wp-login.php', 'login');359 $login_url = wp_login_handler_url(); 336 360 337 361 if ( !empty($redirect) ) 338 362 $login_url = add_query_arg('redirect_to', urlencode($redirect), $login_url); … … 368 392 * 369 393 * @param string $register The user registration URL. 370 394 */ 371 return apply_filters( 'register_url', site_url( 'wp-login.php?action=register', 'login') );395 return apply_filters( 'register_url', add_query_arg( 'action', 'register', wp_login_handler_url() ) ); 372 396 } 373 397 374 398 /** … … 471 495 $login_form_bottom = apply_filters( 'login_form_bottom', '', $args ); 472 496 473 497 $form = ' 474 <form name="' . $args['form_id'] . '" id="' . $args['form_id'] . '" action="' . esc_url( set_url_scheme( wp_login_url(), 'login_post') ) . '" method="post">498 <form name="' . $args['form_id'] . '" id="' . $args['form_id'] . '" action="' . esc_url( wp_login_handler_url('login_post') ) . '" method="post"> 475 499 ' . $login_form_top . ' 476 500 <p class="login-username"> 477 501 <label for="' . esc_attr( $args['id_username'] ) . '">' . esc_html( $args['label_username'] ) . '</label> … … 510 534 $args['redirect_to'] = $redirect; 511 535 } 512 536 513 $lostpassword_url = add_query_arg( $args, network_site_url('wp-login.php', 'login') );537 $lostpassword_url = add_query_arg( $args, wp_login_handler_url( 'login', true ) ); 514 538 515 539 /** 516 540 * Filter the Lost Password URL.