Changeset 6698

Show
Ignore:
Timestamp:
01/31/08 21:47:35 (7 months ago)
Author:
ryan
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 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    ';