[wp-trac] [WordPress Trac] #48205: Warning: Cannot use a scalar value as an array

WordPress Trac noreply at wordpress.org
Sun Oct 6 03:23:38 UTC 2019


#48205: Warning: Cannot use a scalar value as an array
-------------------------------+------------------------------
 Reporter:  radevwp            |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Script Loader      |     Version:  5.2.3
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by jrf):

 @radevwp I've had a quick look at the code in question, but the only way
 this could happen is if the `localize()` function was called with `$l10n`
 set to a scalar value instead of an array.

 To figure out where that function call is made from, a debug backtrace is
 needed.

 Could you please provide that ?

 If you don't know how to get a debug backtrace of the error, have a look
 here at some code you can inject into the `wp-config.php` file on your
 staging server to generate it: https://gist.github.com/jrfnl/5925642

 As a side-note: yes, the function could be coded slightly more
 defensively, but finding out where this is coming from is the more
 important issue.

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


More information about the wp-trac mailing list