[wp-trac] [WordPress Trac] #29722: wp_localize_script should be able to manage scalars

WordPress Trac noreply at wordpress.org
Wed Sep 23 18:03:57 UTC 2015


#29722: wp_localize_script should be able to manage scalars
----------------------------------+------------------------------
 Reporter:  Fab1en                |       Owner:
     Type:  defect (bug)          |      Status:  new
 Priority:  normal                |   Milestone:  Awaiting Review
Component:  I18N                  |     Version:  3.3
 Severity:  normal                |  Resolution:
 Keywords:  has-patch needs-docs  |     Focuses:  javascript
----------------------------------+------------------------------

Comment (by jtsternberg):

 Replying to [comment:12 jtsternberg]:
 > The other option is to to check something like `$is_multi = is_array(
 array_values( $l10n1 )[0] )`

 Derp, that will only check if the first item in the array is an array.
 Looks like we'll have to check `is_array` on every value.

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


More information about the wp-trac mailing list