Title: [Plugin: BAW Moderator Role] in_array Error
Last modified: August 20, 2016

---

# [Plugin: BAW Moderator Role] in_array Error

 *  Resolved [SlothLoveChunk](https://wordpress.org/support/users/slothlovechunk/)
 * (@slothlovechunk)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-baw-moderator-role-in_array-error/)
 * 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!
 * [http://wordpress.org/extend/plugins/baw-moderator-role/](http://wordpress.org/extend/plugins/baw-moderator-role/)

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

 *  Plugin Author [Julio Potier](https://wordpress.org/support/users/juliobox/)
 * (@juliobox)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-baw-moderator-role-in_array-error/#post-2916808)
 * 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 !
 *  [camay123](https://wordpress.org/support/users/camay123/)
 * (@camay123)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-baw-moderator-role-in_array-error/#post-2916951)
 * 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.
 * Thanks
 *  Plugin Author [Julio Potier](https://wordpress.org/support/users/juliobox/)
 * (@juliobox)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-baw-moderator-role-in_array-error/#post-2916952)
 * > plugins/contact-form-7
 * Not mine :/
 *  [camay123](https://wordpress.org/support/users/camay123/)
 * (@camay123)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-baw-moderator-role-in_array-error/#post-2916953)
 * 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](https://wordpress.org/support/users/juliobox/)
 * (@juliobox)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-baw-moderator-role-in_array-error/#post-2916954)
 * 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
 *  [camay123](https://wordpress.org/support/users/camay123/)
 * (@camay123)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-baw-moderator-role-in_array-error/#post-2916955)
 * In functions.php I should add this ?
 *  Plugin Author [Julio Potier](https://wordpress.org/support/users/juliobox/)
 * (@juliobox)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-baw-moderator-role-in_array-error/#post-2916956)
 * No directly on my plugin, i dont have free time to do it and test this sorry
 *  [camay123](https://wordpress.org/support/users/camay123/)
 * (@camay123)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-baw-moderator-role-in_array-error/#post-2916957)
 * 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](https://wordpress.org/support/users/juliobox/)
 * (@juliobox)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-baw-moderator-role-in_array-error/#post-2916958)
 * ok so, let’s go with “4”
    2 lines above, replace “return null;” with “return 
   array();” Thanks
 *  [camay123](https://wordpress.org/support/users/camay123/)
 * (@camay123)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-baw-moderator-role-in_array-error/#post-2916959)
 * 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](https://wordpress.org/support/users/juliobox/)
 * (@juliobox)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-baw-moderator-role-in_array-error/#post-2916960)
 * 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
 *  [camay123](https://wordpress.org/support/users/camay123/)
 * (@camay123)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-baw-moderator-role-in_array-error/#post-2916961)
 * 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](https://wordpress.org/support/users/juliobox/)
 * (@juliobox)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-baw-moderator-role-in_array-error/#post-2916962)
 * So it works now or not ? ^^
 *  [Marcus](https://wordpress.org/support/users/lotuz/)
 * (@lotuz)
 * [13 years ago](https://wordpress.org/support/topic/plugin-baw-moderator-role-in_array-error/#post-2916970)
 * Hello,
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/baw-moderator-role_e8e8e8.svg)
 * [Moderator Role](https://wordpress.org/plugins/baw-moderator-role/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/baw-moderator-role/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/baw-moderator-role/)
 * [Active Topics](https://wordpress.org/support/plugin/baw-moderator-role/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/baw-moderator-role/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/baw-moderator-role/reviews/)

 * 14 replies
 * 4 participants
 * Last reply from: [Marcus](https://wordpress.org/support/users/lotuz/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/plugin-baw-moderator-role-in_array-error/#post-2916970)
 * Status: resolved