[wp-trac] [WordPress Trac] #20110: Add a valued() function to encourage consistency in input fields

WordPress Trac wp-trac at lists.automattic.com
Fri Feb 24 08:13:26 UTC 2012


#20110: Add a valued() function to encourage consistency in input fields
-------------------------+-----------------------------
 Reporter:  jeremyfelt   |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Template     |    Version:
 Severity:  normal       |   Keywords:  has-patch
-------------------------+-----------------------------
 A valued() function would fit well with the helper functions selected()
 and checked().

 Makes it easier to add a value if it exists, and to escape the value with
 esc_attr().

 Makes it easier to provide a placeholder text.

 Use would be:

 {{{
 <input type="text" <?php echo valued( $possible_num, true, '4 digit
 number' ); ?>>
 }}}

 Which would result in:

 {{{
 <input type="text" value="1234" placeholder="4 digit number">
 }}}
 Or
 {{{
 <input type="text" placeholder="4 digit number">
 }}}
 (Depending on the original value of $possible_num)

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20110>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list