Title: Customizer Error &#8211; in_array(), null given
Last modified: May 5, 2017

---

# Customizer Error – in_array(), null given

 *  Resolved [Howdy_McGee](https://wordpress.org/support/users/howdy_mcgee/)
 * (@howdy_mcgee)
 * [9 years ago](https://wordpress.org/support/topic/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() LN92
 * The problem is that **every** filter hook expects a returned value. Here, there’s
   only a returned value if the role matches `editor` or `shop_manager`. As far 
   as I can tell, instead of defaulting to the objects `$components array( 'widgets','
   nav_menus' )` WordPress `apply_filters` returns a default `null` 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
   🙁
    -  This topic was modified 9 years ago by [Howdy_McGee](https://wordpress.org/support/users/howdy_mcgee/).

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [GuyPrimavera](https://wordpress.org/support/users/guyprimavera/)
 * (@guyprimavera)
 * [9 years ago](https://wordpress.org/support/topic/customizer-error-in_array-null-given/#post-9101484)
 * Hi McGee!
 * Thanks a lot for your detailed error report, it’s really helpful! I’ll check 
   it out now.
 * Could you tell me the name of the theme you’re using? Or if you have any plugins
   that might interact with the Customizer?
 * Thanks.
 *  Thread Starter [Howdy_McGee](https://wordpress.org/support/users/howdy_mcgee/)
 * (@howdy_mcgee)
 * [9 years ago](https://wordpress.org/support/topic/customizer-error-in_array-null-given/#post-9101554)
 * I can replicate it on the following system:
 * WordPress 4.7.4
    Theme: Twenty Seventeen 1.2 Plugins: Only this plugin installed
 * When viewing the customizer the errors will be hidden behind 2017 cover image,
   if you view frame source ( on the preview pane ) it’ll show up at the top or 
   the code source. Otherwise it should still show up on`wp-content/deubg.log`
 *  Plugin Author [GuyPrimavera](https://wordpress.org/support/users/guyprimavera/)
 * (@guyprimavera)
 * [9 years ago](https://wordpress.org/support/topic/customizer-error-in_array-null-given/#post-9101561)
 * That’s perfect, thanks!
 *  [ewilson](https://wordpress.org/support/users/ewilson/)
 * (@ewilson)
 * [9 years ago](https://wordpress.org/support/topic/customizer-error-in_array-null-given/#post-9136288)
 * Hi Guy,
 * I am also getting the same warning error as McGee! Do you have any timescales
   of when this solution will be resolved as I would like to continue to use this
   plugin for my Editors to be able to edit the Widgets and Menu’s on their site?
 * Thanks,
    Erin
 *  Plugin Author [GuyPrimavera](https://wordpress.org/support/users/guyprimavera/)
 * (@guyprimavera)
 * [9 years ago](https://wordpress.org/support/topic/customizer-error-in_array-null-given/#post-9136298)
 * Hi E Wilson,
 * Thanks for your feedback. As luck would have it, I’m preparing the files to upload
   the new version now, so it should be ready to upgrade in around 30 minutes. I’ll
   post a message here when it’s online! 🙂
 *  [ewilson](https://wordpress.org/support/users/ewilson/)
 * (@ewilson)
 * [9 years ago](https://wordpress.org/support/topic/customizer-error-in_array-null-given/#post-9136332)
 * Perfect Thanks! 🙂
 *  Plugin Author [GuyPrimavera](https://wordpress.org/support/users/guyprimavera/)
 * (@guyprimavera)
 * [9 years ago](https://wordpress.org/support/topic/customizer-error-in_array-null-given/#post-9136367)
 * No worries, it’s online now and ready to update (sometimes it takes a few minutes
   for your WordPress installation to show an update available).
 * I’ll mark this as resolved for now, but if you have any issues then I can re-
   open it. Thanks again Howdy_McGee for your valuable feedback! 🙂

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Customizer Error – in_array(), null given’ is closed to new replies.

 * ![](https://ps.w.org/editor-menu-and-widget-access/assets/icon-256x256.png?rev
   =1200053)
 * [Editor Menu and Widget Access](https://wordpress.org/plugins/editor-menu-and-widget-access/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/editor-menu-and-widget-access/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/editor-menu-and-widget-access/)
 * [Active Topics](https://wordpress.org/support/plugin/editor-menu-and-widget-access/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/editor-menu-and-widget-access/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/editor-menu-and-widget-access/reviews/)

## Tags

 * [filter](https://wordpress.org/support/topic-tag/filter/)
 * [hook](https://wordpress.org/support/topic-tag/hook/)
 * [solution](https://wordpress.org/support/topic-tag/solution/)

 * 7 replies
 * 3 participants
 * Last reply from: [GuyPrimavera](https://wordpress.org/support/users/guyprimavera/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/customizer-error-in_array-null-given/#post-9136367)
 * Status: resolved