[wp-trac] [WordPress Trac] #35023: get_field_name() returns a bad field name if you pass it "display][avatar_size"

WordPress Trac noreply at wordpress.org
Sun Dec 13 01:37:23 UTC 2015


#35023: get_field_name() returns a bad field name if you pass it
"display][avatar_size"
-------------------------------------------------+-------------------------
 Reporter:  pbearne                              |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  4.4.1
Component:  Widgets                              |     Version:  4.4
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests 2nd-        |     Focuses:
  opinion                                        |  administration
-------------------------------------------------+-------------------------
Changes (by johnbillion):

 * keywords:  has-patch has-unit-tests => has-patch has-unit-tests 2nd-
               opinion
 * milestone:  Awaiting Review => 4.4.1


Comment:

 Replying to [comment:10 pbearne]:
 > The more I look at this I feel this is wrong, if we want the ability to
 pass an '''array''' why aren't passing a '''real array''' instead of
 'sudo' array in a string ( bra[foo][foo] is not an array ) I feel tha the
 patch was wrong.

 The function accepts an array syntax value that is identical to what you
 would use in a `name` attribute directly. Example:

 {{{
 <input name="foo[bar]">
 <input name="foo[bar][baz][]">
 }}}

 vs

 {{{
 $this->get_field_name( 'foo[bar]' );
 $this->get_field_name( 'foo[bar][baz][]' );
 }}}

 Moving to the 4.4.1 milestone for consideration, regardless.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35023#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list