Title: Warning: in_array() [function.in-array]:
Last modified: August 21, 2016

---

# Warning: in_array() [function.in-array]:

 *  [sanct](https://wordpress.org/support/users/sanct/)
 * (@sanct)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/warning-in_array-functionin-array/)
 * Hi
    Every time my ‘add a new porfolio item’ page loads I get this warning.
 * Warning: in_array() [function.in-array]: Wrong datatype for second argument in/
   home/content/88/6940688/html/wordpress1/wp-includes/theme.php on line 1682
 * It then prevents me from adding any media to my new page.
    My theme is Portfolio
   Press version 1.5. I know there is a 1.8 upgrade but I have edited the theme 
   to extend porfolio items and removed date stamps so I don’t want to have to recode
   these parts.
 * FYI this error has only just happened along time after the before mentioned tweaks
   we made.
 * Any info you can give me would be most appreciated.
 * Thanks in advance
 * [http://iconicexistence.com](http://iconicexistence.com)

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

 *  [chaturaka](https://wordpress.org/support/users/chaturaka/)
 * (@chaturaka)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/warning-in_array-functionin-array/#post-4531479)
 * And your code is?
 *  [chaturaka](https://wordpress.org/support/users/chaturaka/)
 * (@chaturaka)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/warning-in_array-functionin-array/#post-4531489)
 * The error simply means you’re not passing an array as the second argument. Take
   a look at the documentation to see the order of the arguments.
 * Give your code to provide you a good solution.
 *  Thread Starter [sanct](https://wordpress.org/support/users/sanct/)
 * (@sanct)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/warning-in_array-functionin-array/#post-4531712)
 * Many thanks for you advice chaturaka.
    I decided to upgrade the theme to solve
   this problem. Now I am just trying to figure out how to create a child theme 
   in my function.php and add a filter???

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

The topic ‘Warning: in_array() [function.in-array]:’ is closed to new replies.

## Tags

 * [array](https://wordpress.org/support/topic-tag/array/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [sanct](https://wordpress.org/support/users/sanct/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/warning-in_array-functionin-array/#post-4531712)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
