WordPress.org

Make WordPress Core

Ticket #18729: get_the_password_form.patch

File get_the_password_form.patch, 1.4 KB (added by philiparthurmoore, 3 years ago)

Adjusted spacing in patch and added semantic classes to form

  • post-template.php

     
    12141214 */ 
    12151215function get_the_password_form() { 
    12161216        global $post; 
    1217         $label = 'pwbox-'.(empty($post->ID) ? rand() : $post->ID); 
    1218         $output = '<form action="' . get_option('siteurl') . '/wp-pass.php" method="post"> 
    1219         <p>' . __("This post is password protected. To view it please enter your password below:") . '</p> 
    1220         <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> 
     1217        $label = 'pwbox-' . ( empty( $post->ID ) ? rand() : $post->ID ); 
     1218        $output = '<form class="post-password-form" action="' . get_option( 'siteurl' ) . '/wp-pass.php" method="post"> 
     1219        <p>' . __( 'This post is password protected. To view it please enter your password below:' ) . '</p> 
     1220        <p><label for="' . $label . '">' . __( 'Password:' ) . ' <input class="post-password-input" name="post_password" id="' . $label . '" type="password" size="20" /></label> <input class="post-password-submit" type="submit" name="Submit" value="' . esc_attr__( 'Submit' ) . '" /></p> 
    12211221        </form> 
    12221222        '; 
    1223         return apply_filters('the_password_form', $output); 
     1223        return apply_filters( 'the_password_form', $output ); 
    12241224} 
    12251225 
    12261226/**