[wp-trac] [WordPress Trac] #20354: Strange behaviour of 'the_password_form' hook
WordPress Trac
wp-trac at lists.automattic.com
Wed Apr 4 13:59:20 UTC 2012
#20354: Strange behaviour of 'the_password_form' hook
--------------------------+-----------------------------
Reporter: egorpromo | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Template | Version: 3.3.1
Severity: normal | Keywords:
--------------------------+-----------------------------
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="http://mysite.com/wordpress/wp-pass.php" method="post">
……
<input type="submit" name="Submit" value="Submit" /></p></form>
</p></div>
<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.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20354>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list