diff --git wp-includes/general-template.php wp-includes/general-template.php
index 939e9de..7c10c58 100644
|
|
|
function wp_loginout($redirect = '', $echo = true) { |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | /** |
| | 200 | * Returns the user registration URL |
| | 201 | * |
| | 202 | * Returns the URL that allows the user to log in to the site |
| | 203 | * |
| | 204 | * @since 3.5.0 |
| | 205 | * @uses site_url() To generate the log in URL |
| | 206 | * @uses apply_filters() calls 'register_url' hook on final url |
| | 207 | * |
| | 208 | * @return string |
| | 209 | */ |
| | 210 | function wp_register_url($redirect = '') { |
| | 211 | if ( is_multisite() ) |
| | 212 | return apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ); |
| | 213 | |
| | 214 | return apply_filters( 'register_url', site_url( 'wp-login.php?action=register', 'login' ), $redirect ); |
| | 215 | } |
| | 216 | |
| | 217 | /** |
| 200 | 218 | * Returns the Log Out URL. |
| 201 | 219 | * |
| 202 | 220 | * Returns the URL that allows the user to log out of the site |
| … |
… |
function wp_login_url($redirect = '', $force_reauth = false) { |
| 247 | 265 | } |
| 248 | 266 | |
| 249 | 267 | /** |
| | 268 | * Return the full URL of the current page |
| | 269 | * |
| | 270 | * @since 3.5.0 |
| | 271 | * |
| | 272 | * @return string |
| | 273 | */ |
| | 274 | function get_current_url() { |
| | 275 | return set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); |
| | 276 | } |
| | 277 | |
| | 278 | /** |
| | 279 | * Whether the current request is for a login page |
| | 280 | * |
| | 281 | * @since 3.5.0 |
| | 282 | * |
| | 283 | * @return bool |
| | 284 | */ |
| | 285 | function is_login_page() { |
| | 286 | $current_url = remove_query_arg( array( 'redirect_to', 'reauth', 'loggedout', 'action' ), get_current_url() ); |
| | 287 | |
| | 288 | return wp_login_url() == $current_url; |
| | 289 | } |
| | 290 | |
| | 291 | /** |
| | 292 | * Whether the current request is for the registration page |
| | 293 | * |
| | 294 | * @since 3.5.0 |
| | 295 | * |
| | 296 | * @return bool |
| | 297 | */ |
| | 298 | function is_register_page() { |
| | 299 | $current_url = remove_query_arg( array( 'action', 'redirect_to', 'loggedout', ), get_current_url() ); |
| | 300 | |
| | 301 | $register_url = remove_query_arg( array( 'action' ), wp_register_url() ); |
| | 302 | |
| | 303 | return $current_url == $register_url; |
| | 304 | } |
| | 305 | |
| | 306 | /** |
| 250 | 307 | * Provides a simple login form for use anywhere within WordPress. By default, it echoes |
| 251 | 308 | * the HTML immediately. Pass array('echo'=>false) to return the string instead. |
| 252 | 309 | * |
| … |
… |
function wp_register( $before = '<li>', $after = '</li>', $echo = true ) { |
| 338 | 395 | |
| 339 | 396 | if ( ! is_user_logged_in() ) { |
| 340 | 397 | if ( get_option('users_can_register') ) |
| 341 | | $link = $before . '<a href="' . site_url('wp-login.php?action=register', 'login') . '">' . __('Register') . '</a>' . $after; |
| | 398 | $link = $before . '<a href="' . wp_register_url() . '">' . __('Register') . '</a>' . $after; |
| 342 | 399 | else |
| 343 | 400 | $link = ''; |
| 344 | 401 | } else { |
diff --git wp-login.php wp-login.php
index 842cd31..673148d 100644
|
|
|
case 'rp' : |
| 507 | 507 | <p id="nav"> |
| 508 | 508 | <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a> |
| 509 | 509 | <?php if ( get_option( 'users_can_register' ) ) : ?> |
| 510 | | | <a href="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login' ) ); ?>"><?php _e( 'Register' ); ?></a> |
| | 510 | | <a href="<?php echo esc_url( wp_register_url() ); ?>"><?php _e( 'Register' ); ?></a> |
| 511 | 511 | <?php endif; ?> |
| 512 | 512 | </p> |
| 513 | 513 | |