| 221 | * Output the navigation links below the login form. |
| 222 | * |
| 223 | * @param string $action The action that brought the visitor to the login page. |
| 224 | * |
| 225 | * @return string The html code for the navigation links. |
| 226 | */ |
| 227 | function wp_login_form_nav_links( $action ) { |
| 228 | $nav_links = array(); |
| 229 | |
| 230 | // Add "Log In" link. |
| 231 | if ( in_array( $action, array( 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register' ) ) ) { |
| 232 | $nav_links[] = sprintf( '<a href="%s">%s</a>', esc_url( wp_login_url() ), __('Log in') ); |
| 233 | } |
| 234 | |
| 235 | // Add "Register" link. |
| 236 | if ( 'register' != $action ) { |
| 237 | if ( ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) && get_option( 'users_can_register' ) ) { |
| 238 | $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ); |
| 239 | |
| 240 | /** This filter is documented in wp-includes/general-template.php */ |
| 241 | $nav_links[] = apply_filters( 'register', $registration_url ); |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | // Add "Lost Password" link. |
| 246 | if ( ! in_array( $action, array( 'lostpassword', 'retrievepassword', 'resetpass', 'rp' ) ) ) { |
| 247 | if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) { |
| 248 | $nav_links[] = sprintf( '<a href="%s">%s</a>', esc_url( wp_lostpassword_url() ), __( 'Lost your password?' ) ); |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | /** |
| 253 | * Filters the login form navigation links. |
| 254 | * |
| 255 | * @since 4.8.0 |
| 256 | * |
| 257 | * @param array $nav_links Links to add to the navigation area below the |
| 258 | * login form. |
| 259 | * @param string $action The action that brought the visitor to the |
| 260 | * login page. |
| 261 | */ |
| 262 | $nav_links = apply_filters( 'wp_login_form_nav_links', $nav_links, $action ); |
| 263 | |
| 264 | /** |
| 265 | * Filters the characters used to join login form navigation links. |
| 266 | * |
| 267 | * @since 4.8.0 |
| 268 | * |
| 269 | * @param string $join_string Default string used to concatenate links. |
| 270 | * @param string $action The action that brought the visitor to the |
| 271 | * login page. |
| 272 | */ |
| 273 | $nav_links_join = apply_filters( 'wp_login_form_nav_links_join', ' | ', $action ); |
| 274 | |
| 275 | echo implode( $nav_links_join, $nav_links ); |
| 276 | } |
| 277 | |
| 278 | /** |
933 | | <?php if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) : |
934 | | if ( get_option( 'users_can_register' ) ) : |
935 | | $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ); |
936 | | |
937 | | /** This filter is documented in wp-includes/general-template.php */ |
938 | | echo apply_filters( 'register', $registration_url ) . ' | '; |
939 | | endif; |
940 | | ?> |
941 | | <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a> |
942 | | <?php endif; ?> |
| 976 | <?php wp_login_form_nav_links( $action ); ?> |