Customizer Error – in_array(), null given
-
I noticed that The Customizer was throwing out errors at the top of the page of a theme I was creating. The errors are:
Warning: in_array() expects parameter 2 to be array, null given in wp-includes\class-wp-customize-manager.php on line 330 Warning: in_array() expects parameter 2 to be array, null given in wp-includes\class-wp-customize-manager.php on line 335
Tracked down the issue, it looks like the problematic code is:
editor-menu-and-widget-access/admin/menus.php
emwa_customiser_mods() LN92The problem is that every filter hook expects a returned value. Here, there’s only a returned value if the role matches
editor
orshop_manager
. As far as I can tell, instead of defaulting to the objects$components array( 'widgets', 'nav_menus' )
WordPressapply_filters
returns a defaultnull
value since the function returns no values.Anyway, if the return it moved outside the final conditional, to the bottom of the function, it should keep the same functionality but also remove this error. As an Admin I currently cannot access Widgets or Menus while this error is happening ??
- The topic ‘Customizer Error – in_array(), null given’ is closed to new replies.