Make WordPress Core

Changeset 6698


Ignore:
Timestamp:
01/31/2008 09:47:35 PM (16 years ago)
Author:
ryan
Message:

Add unique 'for' attribute to labels for post password forms. Props Nazgul. fixes #4721

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post-template.php

    r6592 r6698  
    483483
    484484function get_the_password_form() {
     485    global $post;
     486    $label = 'pwbox-'.(empty($post->ID) ? rand() : $post->ID);
    485487    $output = '<form action="' . get_option('siteurl') . '/wp-pass.php" method="post">
    486488    <p>' . __("This post is password protected. To view it please enter your password below:") . '</p>
    487     <p><label>' . __("Password:") . ' <input name="post_password" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . __("Submit") . '" /></p>
     489    <p><label for="' . $label . '">' . __("Password:") . ' <input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . __("Submit") . '" /></p>
    488490    </form>
    489491    ';
Note: See TracChangeset for help on using the changeset viewer.