WP inserting BRs & Ps in ‘Password Protected’ form
-
Hi guys,
Really annoying problem here: I’ve edited the text that gets displayed above the “Password protected entry” form and I’ve also re-jigged the HTML form to fit within my site structure and CSS, but WordPress is insistent on placing <BR> and </P> tags throughout the form, and it’s driving me nuts. Here’s my code:
function get_the_password_form() { $output = "<p>Think you're part of the Mob eh. What's the codeword wiseguy?</p>" . '<form action="' . get_option('siteurl') . '/wp-pass.php" method="post" class="standardform"><fieldset><label for="post_password">Password </label><input id="post_password" name="post_password" type="password" /><label for="Send"></label><input id="Send" type="submit" name="Submit" value="Go" /></fieldset></form>'; return $output; }
This is what it’s outputting:
<p>Think you’re part of the Mob eh. What’s the codeword wiseguy?</p> <form action="https://phobea.com/wp-pass.php" method="post" class="standardform"><fieldset><label for="post_password">Password </label> <input id="post_password" name="post_password" type="password" /><label for="Send"></label> <input id="Send" type="submit" name="Submit" value="Go" /></fieldset></form>
As you can see it’s putting <BR> tags after the label, not something I want it to do at all as it messes up my formatting. It’s not technically very good HTML either.
As you can see I’ve tried stripping all whitespace from the form (with the proper whitespace, WP adds even more peculiar <BR> and <P> tags throughout. I also searched the functions files for any relevant sr_replace calls but I can’t find any.
Has anybody any idea why this is happening or is it a bug?
- The topic ‘WP inserting BRs & Ps in ‘Password Protected’ form’ is closed to new replies.