• Resolved Howdy_McGee

    (@howdy_mcgee)


    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 7 years, 10 months ago by Howdy_McGee.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author GuyPrimavera

    (@guyprimavera)

    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

    (@howdy_mcgee)

    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 onwp-content/deubg.log

    Plugin Author GuyPrimavera

    (@guyprimavera)

    That’s perfect, thanks!

    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

    (@guyprimavera)

    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! ??

    Perfect Thanks! ??

    Plugin Author GuyPrimavera

    (@guyprimavera)

    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.