[wp-trac] [WordPress Trac] #37332: Enhancement: Add a wrong password message on password protected posts

WordPress Trac noreply at wordpress.org
Fri Mar 12 16:06:51 UTC 2021


#37332: Enhancement: Add a wrong password message on password protected posts
-------------------------------+---------------------
 Reporter:  henry.wright       |       Owner:  (none)
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:
Component:  Posts, Post Types  |     Version:  4.5.3
 Severity:  normal             |  Resolution:
 Keywords:  has-patch          |     Focuses:
-------------------------------+---------------------

Comment (by kreppar):

 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

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/37332#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list