Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am getting errors like

Warning: explode() expects parameter 2 to be string, array given in /data/www/ae/wp-includes/query.php on line 2390
Warning: in_array() expects parameter 2 to be array, null given in /data/www/ae/wp-includes/query.php on line 2399
Warning: in_array() expects parameter 2 to be array, null given in /data/www/ae/wp-includes/query.php on line 2399
Warning: in_array() expects parameter 2 to be array, null given in /data/www/ae/wp-includes/query.php on line 2399
Warning: in_array() expects parameter 2 to be array, null given in /data/www/ae/wp-includes/query.php on line 2399
Warning: in_array() expects parameter 2 to be array, null given in /data/www/ae/wp-includes/query.php on line 2399
Warning: in_array() expects parameter 2 to be array, null given in /data/www/ae/wp-includes/query.php on line 2399
Warning: in_array() expects parameter 2 to be array, null given in /data/www/ae/wp-includes/query.php on line 2399
Warning: in_array() expects parameter 2 to be array, null given in /data/www/ae/wp-includes/query.php on line 2399

Whats wrong?

share|improve this question
    
Have your tried disabling all plugins and switching to default theme? Do the errors still appear? If you do that we can narrow down what is causing the errors –  Brady Jun 17 '11 at 10:09
add comment

5 Answers

up vote 1 down vote accepted

Installing the hotfix plugin may help to solve the problem. http://wordpress.org/extend/plugins/hotfix/

Currently I am using wordpress3.1.3 and got same type errors while browsing the media(media list page) in admin panel and hotfix plugin solves that.

share|improve this answer
add comment

You're not alone. It's a problem with a variable type assumption in WP_Query. I fixed it by editing line 2390 in wp-includes/query.php from this;

$q_status = explode(',', $q['post_status']);

To this:

$q_status = is_array( $q['post_status'] ) ? $q['post_status'] : explode(',', $q['post_status']);

I was going to submit to trac, but I've just checked the trunk and it looks like it's already been fixed. Hopefully it'll make the next release :)

share|improve this answer
add comment

I was experiencing this problem after upgrading to 3.1.3, too. The manual fix you described didn't work for me. I might have overlooked something but couldn't find it if I did.

As suggested by some other users, I installed the Wordpress Hotfix plugin and it corrected the problem...

Michael

share|improve this answer
add comment

First of all open query.php file into wp-includes folder. find this code..

if ( isset($q['post_status']) && $q['post_status'] != '' ) { $statuswheres = array(); $q_status = explode(',', $q['post_status']);

and Replace with :--

if ( ! empty( $q['post_status'] ) ) { $statuswheres = array(); $q_status = $q['post_status']; if ( ! is_array( $q_status ) ) $q_status = explode(',', $q_status);

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.