[wp-trac] [WordPress Trac] #18729: No HTML Classes/IDs Associated With get_the_password_form() Output

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 28 06:08:32 UTC 2011


#18729: No HTML Classes/IDs Associated With get_the_password_form() Output
-----------------------------------+------------------------------
 Reporter:  philiparthurmoore      |       Owner:
     Type:  feature request        |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  General                |     Version:  3.2.1
 Severity:  normal                 |  Resolution:
 Keywords:  westi-likes has-patch  |
-----------------------------------+------------------------------

Comment (by philiparthurmoore):

 Replying to [comment:7 azaozz]:
 > Looking at get_the_password_form.patch we won't need 3 classes to style
 3 elements. A `post-password-form` class on the <form> is enough. Also we
 don't need a randomized ID for both <label> and <input type="password" />
 as the label surrounds the input field.
 >
 > So it would look like this:
 > {{{
 > $output = '<form action="' . get_option('siteurl') . '/wp-pass.php"
 class="post-password-form" method="post">
 > <p>' . __("This post is password protected. To view it please enter your
 password below:") . '</p>
 > <p><label>' . __("Password:") . ' <input name="post_password"
 type="password" size="20" /></label>
 > <input type="submit" name="Submit" value="' . esc_attr__("Submit") . '"
 /></p>';
 > }}}
 >
 > All of the above HTML can be styled with `.post-password-form p`,
 `.post-password-form label input` and even `.post-password-form
 input[type="submit"]` if needed.

 Thank you very much for your suggestions and input, @azaozz. Cheers.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18729#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list