Opened 8 years ago
Last modified 8 months ago
#37332 new enhancement
Enhancement: Add a wrong password message on password protected posts
Reported by: | henry.wright | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.5.3 |
Component: | Posts, Post Types | Keywords: | has-patch |
Focuses: | Cc: |
Description
If a post is password protected, the user is shown a form where they can enter a password to gain access. If a wrong password is given, there's no helpful message shown to the user. The page is simply reloaded.
Something like "Wrong password. Please try again." would be helpful here.
Attachments (2)
Change History (6)
#2
@
8 years ago
- Keywords has-patch added
- Version set to 4.5.3
Agreed - users should definitely get feedback if the post password is inputted incorrectly - see 37332-01.patch for a suggested solution to this.
@
8 years ago
Updated patch file in correct format (trunk dev version) - Adds error message if post password is incorrect. Adds new function get_the_password_form_wrong_password() and new filter 'the_password_form_wrong_password'
#3
@
4 years ago
Hi, I was checking if there were any related tickets before creating a new one and I came across this.
I implemented a solution very similar to the one proposed by @Jonnyauk with the difference that I add a conditional
if ( wp_get_raw_referer() !== get_the_permalink() ) { return $form; }
to check where the request originates and avoid that if the password is wrong, it is shown in all post them with password protection.
@SergeyBiryukov is there a will to push this old request? In that case I can send a PR.
Thanks
This ticket was mentioned in PR #6116 on WordPress/wordpress-develop by @tommusrhodus.
8 months ago
#4
Adds filters and markup to handle showing an "incorrect post password" message whenever using the post password system and the user enters a wrong password.
There is a current edge case where the "incorrect post password" message will show if:
- The user visits the page and enters and incorrect post password.
- "incorrect post password" message shown as expected.
- The user then clicks a navigation link to the same page.
- "incorrect post password" message shown again because the referrer was the current page, even though the form wasn't submitted.
Trac ticket: https://core.trac.wordpress.org/ticket/37332
Adds error message if post password is incorrect. Adds new function get_the_password_form_wrong_password() and new filter 'the_password_form_wrong_password'