WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/07/2013 11:49:57 AM (7 years ago)
Author:
westi
Message:

Make is much easier for a theme to style the Post Password form.

Fixes #18729 props philiparthurmoore for the original patches.

File:
1 edited

Legend:

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

    r24974 r25010  
    12331233function get_the_password_form( $post = 0 ) {
    12341234    $post = get_post( $post );
    1235     $label = 'pwbox-' . ( empty($post->ID) ? rand() : $post->ID );
    1236     $output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" method="post">
    1237     <p>' . __("This post is password protected. To view it please enter your password below:") . '</p>
    1238     <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>
    1239 </form>
     1235    $output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form" method="post">
     1236    <p>' . __( 'This post is password protected. To view it please enter your password below:' ) . '</p>
     1237    <p><label>' . __( 'Password:' ) . ' <input name="post_password" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . esc_attr__( 'Submit' ) . '" /></p>
     1238    </form>
    12401239    ';
    1241     return apply_filters('the_password_form', $output);
     1240    return apply_filters( 'the_password_form', $output );
    12421241}
    12431242
Note: See TracChangeset for help on using the changeset viewer.