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

WordPress Trac noreply at wordpress.org
Wed Oct 23 19:49:26 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 ciapci):

 Replying to [comment:10 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.

 I used this code: http://d.pr/i/MMnc and I'm getting this:
 http://d.pr/i/HaYl.

 It only shows once if I remove the true and the echo. But I need to set
 the result as a variable.

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


More information about the wp-trac mailing list