[wp-trac] [WordPress Trac] #12133: get_field_id() and get_field_name() break when passed a name in array format

WordPress Trac noreply at wordpress.org
Mon Jan 21 23:13:02 UTC 2013


#12133: get_field_id() and get_field_name() break when passed a name in array
format
-------------------------+-----------------------------
 Reporter:  johnbillion  |       Owner:  azaozz
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  Widgets      |     Version:  2.9.1
 Severity:  minor        |  Resolution:
 Keywords:  needs-patch  |
-------------------------+-----------------------------

Comment (by ch1902):

 1) No, but it could be simplified to
 {{{
 strtr($field_name, '[] ', '---')
 }}}
 However that produces less than attractive IDs such as "a-b--c-" from
 "a[b][c]" instead of my version which produces "a-b-c". I have no opinion
 on sanitize_title_with_dashes because I don't know much of the internals
 of Wordpress and was sticking to pure PHP.

 2) The logic is correct and does not produce nested brackets, I did test
 on my local copy before submitting.

 3) I didn't realise the source used tabs, my IDE auto converted them. I
 didn't see any problems with spaces in the other patches I could find but
 I'll remember if I ever dare to submit a patch again.

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


More information about the wp-trac mailing list