Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#40802 closed enhancement (fixed)

Allow filtering of the hard coded pipe character in wp-login.php

Reported by: henrywright's profile henry.wright Owned by: johnbillion's profile johnbillion
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: Login and Registration Keywords: has-patch
Focuses: Cc:

Description

<p id="nav">
<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a> |
<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a>
</p>

The pipe character is hard coded in wp-login.php as can be seen from the snippet above.

It would be nice to have the ability to remove or modify the character.

Attachments (3)

40802.diff (2.6 KB) - added by henry.wright 7 years ago.
40802.2.diff (2.2 KB) - added by henry.wright 7 years ago.
40802.3.diff (2.3 KB) - added by henry.wright 7 years ago.
40802.3.diff changes the name of the filter and filters once only.

Download all attachments as: .zip

Change History (13)

#1 @henry.wright
8 years ago

  • Summary changed from Allow filtering of the hard coded pipe character on wp.login.php to Allow filtering of the hard coded pipe character in wp-login.php

#2 @henry.wright
8 years ago

  • Component changed from General to Login and Registration

@henry.wright
7 years ago

#3 @henry.wright
7 years ago

  • Keywords has-patch added

The | pipe character actually appears 4 times inside wp-login.php. 40802.diff makes the character filterable by adding a login_divider filter.

This can be tested visually with something like:

add_filter( 'login_divider', function( $divider ) {
    $divider = ' # ';
    return $divider;
} );

#4 @SergeyBiryukov
7 years ago

  • Keywords needs-refresh added
  • Milestone changed from Awaiting Review to 4.9

Only one instance of the hook needs the full DocBlock, others should have a duplicate hook reference.

#5 @henry.wright
7 years ago

@SergeyBiryukov which hook would you consider to be the primary?

@henry.wright
7 years ago

#6 @henry.wright
7 years ago

  • Keywords needs-refresh removed

40802.2.diff documents the primary filter hook only. My thinking is the login form filter should serve as the primary but I can amend if needed.

@henry.wright
7 years ago

40802.3.diff changes the name of the filter and filters once only.

#7 @henry.wright
7 years ago

Here's an example filter which can be used to test:

add_filter( 'login_link_separator', function() {
    return ' # ';
} );

#8 @eddhurst
7 years ago

Have tested, looks good. Thanks for function to test.

#9 @johnbillion
7 years ago

  • Owner set to johnbillion
  • Status changed from new to reviewing

#10 @johnbillion
7 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 41291:

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

Note: See TracTickets for help on using tickets.