Support » Plugin: Moderator Role » [Plugin: BAW Moderator Role] in_array Error

  • Resolved SlothLoveChunk


    Hello, first off, great plug-in.

    Just a heads up that with the latest BuddyPress 1.6 trunk this plug-in now triggers the following error:

    Warning: in_array() expects parameter 2 to be array, null given in "/wp-content/plugins/buddypress/bp-core/bp-core-caps.php on line 414"

    This error only appears when a user is logged in and has the “Moderator” role assigned (i.e. it doesn’t appear for admins, editors, authors, subscribers, or any other built-in role). The error shows in the comment admin and comment stream and repeats for each comment.

    I know plug-ins conflict, but since BuddyPress is a pretty common one and is due for a big update soon I thought it was worth notifying you.

    Thanks again!

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Julio Potier


    Ok thank you
    I check both codes and i do not understand why “caps” for “moderator” can be something else than array 😐
    But thank you for pointing me this !

    I get an error similar to this:

    Warning: array_diff() [function.array-diff]: Argument #1 is not an array in /home/…/public_html/wp-content/plugins/contact-form-7/includes/capabilities.php on line 12

    Only visible in the moderator account.

    the error is repeated a few times on top of the comments list.


    Plugin Author Julio Potier



    Not mine :/

    I understand, but only when I use YOUR plugin that I have this error. I just tried another plugin for moderator role and it its working ok, but shows to much of the control panel.

    Anyhow, ill have to use something else I guess.

    Plugin Author Julio Potier


    ok try to change this :
    add_filter(‘map_meta_cap’, ‘bawmro_map_meta_cap’, 10, 4 );
    and play with “4”, try “1” and try “9999”
    Feedback me thanks

    In functions.php I should add this ?

    Plugin Author Julio Potier


    No directly on my plugin, i dont have free time to do it and test this sorry

    If I put “1” I get errors at activation of plugin, and if I put 9999 I get no errors. I can login as the comment moderator, but the user can only edit the profile and see comments. nothing else.

    Plugin Author Julio Potier


    ok so, let’s go with “4”
    2 lines above, replace “return null;” with “return array();”

    set back to 4
    replaced return null with return array();

    no more errors in user moderator account but doesnt have the edit capabilities for comments nor the comment section in the left sidebar.

    Can only see the list of recent comments in dashboard.

    Thanks alot for your time in advance.

    Plugin Author Julio Potier


    ok, can you try “5” instead of “4” ? If it doesn’t work i’ll try to give you a php fix to avoid hacking CF7

    ok, lets rewind a bit.

    With 4 it worked. I had forgotten to set back the user to a role of “Moderator” and was left to “Comments Moderator” from another plugin.

    So, after changing “return null;” with “return array();” and keeping “4”

    So thanks for the help.

    Greatly appreciated.

    Plugin Author Julio Potier


    So it works now or not ? ^^


    yes, moderation (deleting, editing, …) is working and no error appears.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘[Plugin: BAW Moderator Role] in_array Error’ is closed to new replies.