3 | | However, where is that warning coming from? For back-compat reasons `$wp_scripts->localize()` does `foreach ( (array) $l10n as $key => $value )`, i.e. it supports passing a string as mentioned in the ticket, and the string should be cast to array. |
| 3 | However, where is that warning coming from? For back-compat reasons `$wp_scripts->localize()` does: |
| 4 | |
| 5 | |
| 6 | {{{ |
| 7 | if ( is_array( $l10n ) ... |
| 8 | ... |
| 9 | foreach ( (array) $l10n as $key => $value ) |
| 10 | ... |
| 11 | }}} |
| 12 | |
| 13 | I.e. it supports passing a string as mentioned in the ticket, and the string should be cast to array. |