Support » Fixing WordPress » Extra brake tags in get_the_password_form

  • Resolved ABTOP

    (@abtop)


    Here’s the get_the_password_form() function from post-template.php

    function get_the_password_form() {
    	global $post;
    	$label = 'pwbox-'.(empty($post->ID) ? rand() : $post->ID);
    	$output = '<form action="' . get_option('siteurl') . '/wp-pass.php" method="post">
    	<p>' . __("This post is password protected. To view it please enter your password below:") . '</p>
    	<p><label for="' . $label . '">' . __("Password:") . ' <input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . esc_attr__("Submit") . '" /></p>
    	</form>
    	';
    	return apply_filters('the_password_form', $output);
    }

    Here’s my output

    <form method="post" action="http://192.168.1.101/wp31/wp-pass.php">
    <p>This post is password protected. To view it please enter your password below:</p>
    <p><label for="pwbox-115">Password:<br>
    <input type="password" size="20" id="pwbox-115" name="post_password"></label><br>
    <input type="submit" value="Submit" name="Submit"></p></form>

    See the two brake tags, one after “Password:” and the other after </label>? Where do they come from?

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Extra brake tags in get_the_password_form’ is closed to new replies.