[wp-trac] [WordPress Trac] #48599: Warning: count(): Parameter must be an array or an object that implements Countable in ../wp-admin/includes/plugin.php on line 1392

WordPress Trac noreply at wordpress.org
Thu Nov 14 21:52:59 UTC 2019


#48599: Warning: count(): Parameter must be an array or an object that implements
Countable in ../wp-admin/includes/plugin.php on line 1392
----------------------------+---------------------
 Reporter:  ispreview       |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  5.3.1
Component:  Administration  |     Version:  5.3
 Severity:  normal          |  Resolution:
 Keywords:  needs-patch     |     Focuses:  ui
----------------------------+---------------------

Comment (by NextScripts):

 Please see my example above. I am passing clear integer values 1 and 2 as
 parameters. Getting error. Integer is "countable", right?


 Replying to [comment:8 adamsilverstein]:
 > I'm not sure this is a WordPress bug, it looks like this is happening
 when plugins/themes are mistakenly passing a non-countable 7th variable.
 The `add_submenu_page` function did not support the 7th variable until we
 added it for `position` (as an int) in WordPress 5.3. Passing anything
 there was unexpected and unsupported.
 >
 > Perhaps if a non countable value is passed here, we should throw a
 `_doing_it_wrong` and use the default priority? What do you think
 @welcher?
 >
 > I see this was fixed upstream in the `NextScripts: Social Networks Auto-
 Poster` plugin:  https://plugins.trac.wordpress.org/changeset/2192461
 /estimate-delivery-date-for-woocommerce/trunk/admin/class-pi-edd-menu.php
 >

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


More information about the wp-trac mailing list