Support » Plugin: Adminimize » PHP Warning: in_array() expects parameter 2 to be array

  • I am getting lots of these errors in my debug.log:

    [24-May-2015 02:50:13 UTC] PHP Warning: in_array() expects parameter 2 to be array, string given in /home/public_html/wp-content/plugins/adminimize/adminimize.php on line 901

    Line 901:
    if ( isset( $mw_adminimize_menu ) && in_array( $item[ 2 ], $mw_adminimize_menu ) ) {
    					unset( $menu[ $index ] );
    }

    Possible fix by adding an in_array condition check for $mw_adminimize_menu:

    if ( isset( $mw_adminimize_menu ) && in_array($mw_adminimize_menu) && in_array( $item[ 2 ], $mw_adminimize_menu ) ) {
    					unset( $menu[ $index ] );
    }

    Let me know what you think!

    https://wordpress.org/plugins/adminimize/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Sorry, I made an error in the fix, I meant is_array instead of in_array so here’s the corrected fix:

    if ( isset( $mw_adminimize_menu ) && is_array($mw_adminimize_menu) && in_array( $item[ 2 ], $mw_adminimize_menu ) ) {
    					unset( $menu[ $index ] );
    }

    Thank you for the fix, Denis Lam!

    Frank Bültge, for your information I was having the same issue. I was seeing it on my WP MU site network dashboard. Please add that hot fix.

    Plugin Author Frank

    (@bueltge)

    Thanks for the hint. Please can you use the current dev version and test this again – https://github.com/bueltge/Adminimize/archive/master.zip

    Thanks for your feedback.

    Denis Lam

    (@spiffyd)

    I just installed the master will give it a spin!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP Warning: in_array() expects parameter 2 to be array’ is closed to new replies.