Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#20354 closed defect (bug) (duplicate)

Strange behaviour of 'the_password_form' hook

Reported by: egorpromo's profile egorpromo Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3.1
Component: Template Keywords:
Focuses: Cc:


I try add filter function to get_the_password_form() function for the sake of improving HTML. I use 'the_password_form' hook:

add_filter('the_password_form', 'improve_password_form');
function improve_password_form($output)
	return '	<div class="password-form">'.$output.'</div><!-- .password-form -->';

When I look at HTML-code I see tags <p> and </p> that added in different places:

<div class="password-form">
<form action="" method="post">
<input type="submit" name="Submit" value="Submit" /></p></form>
<p><!-- .password-form --></p>

I don’t understand how <p> and </p> can appear about “<!-- .password-form -->” string. It must not be there. When I delete my filter all is correct and form have view like in wp-includes/post-template.php.

I think it is bug. I can’t use 'the_password_form' filter hook to modify form.

Change History (1)

#1 @SergeyBiryukov
12 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.