Title: [Plugin: Restrict Categories] Error when using plugin&#8230;
Last modified: August 19, 2016

---

# [Plugin: Restrict Categories] Error when using plugin…

 *  Resolved [Peja](https://wordpress.org/support/users/peja1389/)
 * (@peja1389)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-restrict-categories-error-when-using-plugin/)
 * I get this for every category on the edit screen.
 * > Warning: in_array() [function.in-array]: Wrong datatype for second argument
   > in /home/mysite/public_html/wp-content/plugins/restrict-categories/restrict-
   > categories.php on line 204

Viewing 7 replies - 16 through 22 (of 22 total)

[←](https://wordpress.org/support/topic/plugin-restrict-categories-error-when-using-plugin/?output_format=md)
[1](https://wordpress.org/support/topic/plugin-restrict-categories-error-when-using-plugin/?output_format=md)
2

 *  [misthero](https://wordpress.org/support/users/misthero/)
 * (@misthero)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-restrict-categories-error-when-using-plugin/page/2/#post-1777310)
 * oh it works! I redownloaded and applied the fix, the plugin now seem to work 
   as intended.
 * You have not to be sorry since you are here giving us your support, this make
   the plugin already better than others where developers never answer 🙂
 * as a side note, just to know, is it normal that if I check the default wordpress
   category “Uncategorized” for any role, all the roles below get every category
   checked?
 * I’m very grateful you helped me with this, if anything I can do to help with 
   the plugin… I know css very well, or if you need something like translating it
   to Italian or Spanish you can contact me.
 * Thank you!
 *  Plugin Author [Matthew Muro](https://wordpress.org/support/users/mmuro/)
 * (@mmuro)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-restrict-categories-error-when-using-plugin/page/2/#post-1777311)
 * No, that’s not normal behavior.
 * What browser and operating system are you on?
 *  [misthero](https://wordpress.org/support/users/misthero/)
 * (@misthero)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-restrict-categories-error-when-using-plugin/page/2/#post-1777312)
 * windows 7 and xp under virtual machine
 * Since I am web designer I have many browsers installed to test cross-browser 
   compatibility, anyway I normally surf the internet on firefox..
 * edit: I checked and it happens on ie, firefox, chrome and safary
 *  [misthero](https://wordpress.org/support/users/misthero/)
 * (@misthero)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-restrict-categories-error-when-using-plugin/page/2/#post-1777313)
 * here is a screenshot:
 * `http://img802.imageshack.us/i/20543152.jpg/`
 * I checked only the category “Uncategorized” for the Editor, once I saved every
   other category for the roles below get checked and I have to manually remove 
   the check and save again
 * is not a big issue anyway.. 🙂
 *  Plugin Author [Matthew Muro](https://wordpress.org/support/users/mmuro/)
 * (@mmuro)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-restrict-categories-error-when-using-plugin/page/2/#post-1777314)
 * It’s not limited to browser or OS. From testing, it looks like my “fix” for the
   error the original poster broke the logic for the check boxes.
 * You can try replacing lines 213-218 with the follow and see if it works.
 *     ```
       if ( is_array($settings[ $id ]) && in_array( $option, $settings[ $id ] ) )
       $checked = 'checked="checked"';
       else
       $checked = '';
       ```
   
 * I don’t get any errors with this on PHP 5.2 or 5.3, so I’m hoping this is the“
   real” fix.
 *  [misthero](https://wordpress.org/support/users/misthero/)
 * (@misthero)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-restrict-categories-error-when-using-plugin/page/2/#post-1777315)
 * yes! that worked, the strange behavior is gone, and no error is showing, categories
   are being restricted, everything seems perfect now.
 * I’ll continue working on this site on the next days and will continue testing
   your plugin, I’ll let you know if something else appear.
 * Thank you again, both for the plugin and your help 🙂
 *  Plugin Author [Matthew Muro](https://wordpress.org/support/users/mmuro/)
 * (@mmuro)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-restrict-categories-error-when-using-plugin/page/2/#post-1777317)
 * Awesome. Glad we could troubleshoot this.
 * I won’t have an official release to correct these bugs until after the US holidays(
   next week). Let me know if you find any other problems with it, though!

Viewing 7 replies - 16 through 22 (of 22 total)

[←](https://wordpress.org/support/topic/plugin-restrict-categories-error-when-using-plugin/?output_format=md)
[1](https://wordpress.org/support/topic/plugin-restrict-categories-error-when-using-plugin/?output_format=md)
2

The topic ‘[Plugin: Restrict Categories] Error when using plugin…’ is closed to 
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/restrict-categories.svg)
 * [Restrict Categories](https://wordpress.org/plugins/restrict-categories/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/restrict-categories/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/restrict-categories/)
 * [Active Topics](https://wordpress.org/support/plugin/restrict-categories/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/restrict-categories/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/restrict-categories/reviews/)

 * 22 replies
 * 3 participants
 * Last reply from: [Matthew Muro](https://wordpress.org/support/users/mmuro/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-restrict-categories-error-when-using-plugin/page/2/#post-1777317)
 * Status: resolved