[wp-trac] [WordPress Trac] #25668: selected, checked functions

WordPress Trac noreply at wordpress.org
Wed Oct 23 19:40:54 UTC 2013


#25668: selected, checked functions
-------------------------------------+------------------------------
 Reporter:  ciapci                   |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  General                  |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  reporter-feedback close  |
-------------------------------------+------------------------------

Comment (by toscho):

 Replying to [comment:9 ciapci]:

 > Ithe checked function is using the `__checked_selected_helper` function
 and in it, the $echo variable is under a if. Basically, if it's set to
 true, it echoes the string as it should, but if it is not set, it still
 echoes.

 No, it doesn’t. `$echo` is a required parameter here, if you don’t pass a
 value for it, you get a PHP error. And if it is `false`, nothing is
 printed.

 > If using that code you mentionedm you should get printed
 checked='checked'  twice. That is not normal.

 You control both places where the return value is printed. Try it. This is
 exactly what you can expect from the existing code.

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


More information about the wp-trac mailing list