[wp-trac] [WordPress Trac] #35268: Allow comparison of multiple values for checked(), selected(), and disabled()

WordPress Trac noreply at wordpress.org
Wed Dec 30 22:45:58 UTC 2015


#35268: Allow comparison of multiple values for checked(), selected(), and
disabled()
--------------------------------------------+------------------------------
 Reporter:  kingkool68                      |       Owner:
     Type:  enhancement                     |      Status:  new
 Priority:  normal                          |   Milestone:  Awaiting Review
Component:  Formatting                      |     Version:
 Severity:  normal                          |  Resolution:
 Keywords:  has-patch has-unit-tests close  |     Focuses:
--------------------------------------------+------------------------------
Changes (by johnbillion):

 * keywords:  has-patch has-unit-tests => has-patch has-unit-tests close
 * component:  General => Formatting


Comment:

 Thanks for the patch @kingkool68, but I don't believe we need any changes
 here. You can do this currently by passing `in_array()` to `checked()`:

 {{{
 <input type="checkbox" <?php checked( in_array( $day, $selected_days ) );
 ?>>
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35268#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list