Login and Registration: Introduce a `login_link_separator` filter to allow the separator between links in the footer of the
login screen to be filtered. Props henry.wright Fixes #40802 git-svn-id: https://develop.svn.wordpress.org/trunk@41291 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9990abec14
commit
0d407f3625
|
@ -430,6 +430,15 @@ do_action( "login_form_{$action}" );
|
||||||
$http_post = ('POST' == $_SERVER['REQUEST_METHOD']);
|
$http_post = ('POST' == $_SERVER['REQUEST_METHOD']);
|
||||||
$interim_login = isset($_REQUEST['interim-login']);
|
$interim_login = isset($_REQUEST['interim-login']);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filters the separator used between login form navigation links.
|
||||||
|
*
|
||||||
|
* @since 4.9.0
|
||||||
|
*
|
||||||
|
* @param string $login_link_separator The separator used between login form navigation links.
|
||||||
|
*/
|
||||||
|
$login_link_separator = apply_filters( 'login_link_separator', ' | ' );
|
||||||
|
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
|
|
||||||
case 'postpass' :
|
case 'postpass' :
|
||||||
|
@ -555,8 +564,10 @@ case 'retrievepassword' :
|
||||||
if ( get_option( 'users_can_register' ) ) :
|
if ( get_option( 'users_can_register' ) ) :
|
||||||
$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
|
$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
|
||||||
|
|
||||||
|
echo esc_html( $login_link_separator );
|
||||||
|
|
||||||
/** This filter is documented in wp-includes/general-template.php */
|
/** This filter is documented in wp-includes/general-template.php */
|
||||||
echo ' | ' . apply_filters( 'register', $registration_url );
|
echo apply_filters( 'register', $registration_url );
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
</p>
|
</p>
|
||||||
|
@ -668,8 +679,10 @@ case 'rp' :
|
||||||
if ( get_option( 'users_can_register' ) ) :
|
if ( get_option( 'users_can_register' ) ) :
|
||||||
$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
|
$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
|
||||||
|
|
||||||
|
echo esc_html( $login_link_separator );
|
||||||
|
|
||||||
/** This filter is documented in wp-includes/general-template.php */
|
/** This filter is documented in wp-includes/general-template.php */
|
||||||
echo ' | ' . apply_filters( 'register', $registration_url );
|
echo apply_filters( 'register', $registration_url );
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
</p>
|
</p>
|
||||||
|
@ -744,7 +757,8 @@ case 'register' :
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<p id="nav">
|
<p id="nav">
|
||||||
<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a> |
|
<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
|
||||||
|
<?php echo esc_html( $login_link_separator ); ?>
|
||||||
<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a>
|
<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -936,7 +950,9 @@ default:
|
||||||
$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
|
$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
|
||||||
|
|
||||||
/** This filter is documented in wp-includes/general-template.php */
|
/** This filter is documented in wp-includes/general-template.php */
|
||||||
echo apply_filters( 'register', $registration_url ) . ' | ';
|
echo apply_filters( 'register', $registration_url );
|
||||||
|
|
||||||
|
echo esc_html( $login_link_separator );
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a>
|
<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a>
|
||||||
|
|
Loading…
Reference in New Issue