[wp-trac] [WordPress Trac] #10556: Ability to compare arrays in checked() function

WordPress Trac wp-trac at lists.automattic.com
Thu Aug 6 12:02:22 UTC 2009


#10556: Ability to compare arrays in checked() function
-------------------------+--------------------------------------------------
 Reporter:  sudar        |       Owner:                   
     Type:  enhancement  |      Status:  new              
 Priority:  normal       |   Milestone:  Unassigned       
Component:  Template     |     Version:                   
 Severity:  normal       |    Keywords:  checked, template
-------------------------+--------------------------------------------------
 The checked() function checks whether two parameters passed to it are
 equal and then outputs checked='checked', which can be used in forms
 having checkboxes or radio buttons.

 Sometimes (particularly for checkboxes), we might need to check for
 multiple values. So I am proposing a change to the checked() function.

 It can first check whether the default value is an array and if yes, it
 can return checked='checked' if the current value is present in the
 default array.

 I have attached a patch with this change.

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


More information about the wp-trac mailing list