Title: error: array_search() expects parameter 2 to be array
Last modified: August 21, 2016

---

# error: array_search() expects parameter 2 to be array

 *  Resolved [Frederik](https://wordpress.org/support/users/hallpick/)
 * (@hallpick)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/error-array_search-expects-parameter-2-to-be-array/)
 * Hi all
 * When I want to install a new plugin on /wp-admin/update.php?action=install-plugin&
   plugin=facebook-auto-publish&_wpnonce=c0e2b1a590
 * I get this error:
    Warning: array_search() expects parameter 2 to be array, object
   given in /customers/7/1/e/openantwerpen.be/httpd.www/wp-content/plugins/all-in-
   one-event-calendar/all-in-one-event-calendar.php on line 160 Fatal error: Cannot
   use object of type stdClass as array in /customers/7/1/e/openantwerpen.be/httpd.
   www/wp-content/plugins/all-in-one-event-calendar/all-in-one-event-calendar.php
   on line 160
 * What to do?
 * Thank you
    Fred
 * [https://wordpress.org/plugins/all-in-one-event-calendar/](https://wordpress.org/plugins/all-in-one-event-calendar/)

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

 *  [Jashan](https://wordpress.org/support/users/jashan/)
 * (@jashan)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/error-array_search-expects-parameter-2-to-be-array/#post-4716824)
 * Hello,
 * To fix this, please FTP your site, and go to Wp-content -> plugins -> All in 
   one calendar -> all-in-one-calendar.php and delete the following code at line
   128
    unset( $plugins->active[ array_search( $basename, $plugins->active ) ] );
 * This should fix the issue.
    Thanks
 *  Thread Starter [Frederik](https://wordpress.org/support/users/hallpick/)
 * (@hallpick)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/error-array_search-expects-parameter-2-to-be-array/#post-4716844)
 * thank you very much, Jashan, this removed the error. Caveat for other users: 
   The code was not on line 128.
 *  [imusmi](https://wordpress.org/support/users/imusmi/)
 * (@imusmi)
 * [12 years ago](https://wordpress.org/support/topic/error-array_search-expects-parameter-2-to-be-array/#post-4716955)
 * Great …..its working
    GOD BLESS YOU MAN
 *  [cefiar](https://wordpress.org/support/users/cefiar/)
 * (@cefiar)
 * [12 years ago](https://wordpress.org/support/topic/error-array_search-expects-parameter-2-to-be-array/#post-4716956)
 * Note: Code is line 128 in 1.11.x-pro, and line 160 in 1.10.x-standard
 *  [kelleychambers](https://wordpress.org/support/users/kelleychambers/)
 * (@kelleychambers)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/error-array_search-expects-parameter-2-to-be-array/#post-4716964)
 * Thank you! This solved my problem as well!! **tips hat!**

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

The topic ‘error: array_search() expects parameter 2 to be array’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/all-in-one-event-calendar.svg)
 * [Timely All-in-One Events Calendar](https://wordpress.org/plugins/all-in-one-event-calendar/)
 * [Support Threads](https://wordpress.org/support/plugin/all-in-one-event-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/all-in-one-event-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/all-in-one-event-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/all-in-one-event-calendar/reviews/)

 * 5 replies
 * 5 participants
 * Last reply from: [kelleychambers](https://wordpress.org/support/users/kelleychambers/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/error-array_search-expects-parameter-2-to-be-array/#post-4716964)
 * Status: resolved