[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
Mon Nov 18 00:25:29 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:
                                                 |  adamsilverstein
     Type:  defect (bug)                         |      Status:  accepted
 Priority:  normal                               |   Milestone:  5.3.1
Component:  Administration                       |     Version:  5.3
 Severity:  normal                               |  Resolution:
 Keywords:  dev-feedback has-patch needs-        |     Focuses:  ui
  testing                                        |
-------------------------------------------------+-------------------------

Comment (by garrett-eclipse):

 Hello @123host thanks for the report and confirmation about the workaround
 solving your issue for now.

 I took a look at your more comprehensive
 [https://core.trac.wordpress.org/ticket/48249#comment:21 post], and see it
 has the same root cause as what I'm hoping to address in my patch
 ([https://core.trac.wordpress.org/attachment/ticket/48599/48599.1.diff
 48599.1.diff]).
 That being the same `menu_slug` and `parent_slug` is used in the
 `add_submenu_page` call.
 So to make workaround #1 work in your case if you do want to use $postion,
 then setting `menu_slug` to `dk_speakout_child` should also work around
 the issue.

 As to your other comment;
 'I have found that some sites throw and error when the position integer is
 in quotes and others thrown the error when it isn't in quotes.'
 The error should be slightly different when you supply a quoted $postion,
 as it's not an integer in that case it should trigger this
 `_doing_it_wrong`;
 https://github.com/WordPress/WordPress/blob/master/wp-
 admin/includes/plugin.php#L1378-L1389

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


More information about the wp-trac mailing list