WordPress.org

Forums

[resolved] Extra brake tags in get_the_password_form (5 posts)

  1. ABTOP
    Member
    Posted 4 years ago #

    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?

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    They may be inserted by your browser when trying to view the source of the page.

  3. ABTOP
    Member
    Posted 4 years ago #

    No, looks like the brakes are in the source code.

  4. Sergey Biryukov
    WordPress Dev
    Posted 4 years ago #

  5. ABTOP
    Member
    Posted 4 years ago #

    Wow! This is incredibly expeditious. Thank you very much, Sergey.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.