[wp-hackers] Ability to compare arrays in checked() function

Sudar Muthu sudar at sudarmuthu.com
Thu Aug 6 12:10:18 UTC 2009


Hi all,

The checked() function (present in wp-admin/includes/template.php) 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 created a new ticket and have attached a patch with this change.<
http://core.trac.wordpress.org/ticket/10556>

Do let me know what you guys think about it.
 With Regards,
Sudar

http://SudarMuthu.com
http://twitter.com/sudarmuthu


More information about the wp-hackers mailing list