Title: [UPDATE Error]wp-includes/query.php array line 2390
Last modified: August 20, 2016

---

# [UPDATE Error]wp-includes/query.php array line 2390

 *  [unrelatedmedia](https://wordpress.org/support/users/unrelatedmedia/)
 * (@unrelatedmedia)
 * [15 years ago](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/)
 * Since the update on my local host I recieved the following errors:
    `Warning:
   explode() expects parameter 2 to be string, array given in C:\wamp\www\wp theme\
   wp-includes\query.php on line 2390` and `Warning: in_array() expects parameter
   2 to be array, null given in C:\wamp\www\wp theme\wp-includes\query.php on line
   2399`
 * Now, I don’t know if it actually fixed anything but I edited the file to force
   an array and it seemed to remove the errors well enough. I don’t know of any 
   adverse affects to doing this yet.
 *     ```
       var_dump($q['post_status']);
       			$statuswheres = array();
       			$q_status = $q['post_status'];//explode(',', $q['post_status']);
       			$r_status = array();
       			$p_status = array();
       			$e_status = array();
       			if ( $q['post_status'] == 'any' ) {
       				foreach ( get_post_stati( array('exclude_from_search' => true) ) as $status )
       					$e_status[] = "$wpdb->posts.post_status <> '$status'";
       			} else {
       				foreach ( get_post_stati() as $status ) {
       					if ( in_array( $status, array($q_status) ) ) {//previously ## if ( in_array( $status, $q_status ) ) {
       ```
   
 * I added the dump as a check to see just what is being retrieved. For some reason
   the original update file recieved the post variable as an array, not a string
   to use explode() on. This forced the initial $q_status to recieve an error when
   attempting to build an array using the explode() because explode() expects a 
   string to break apart, not an array…which is what it was recieving.
 * As such, the $q_status array wasn’t being set. To further the oddity, the in_array()
   on line 2399 was being fed $q_status which was a string, not an the expected 
   array.
 * Can someone tell me if my temporary solution is, in fact, a solution or if I 
   should expect it to cause errors down the road?

Viewing 15 replies - 1 through 15 (of 28 total)

1 [2](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/page/2/?output_format=md)

 *  [cabgfx](https://wordpress.org/support/users/cabgfx/)
 * (@cabgfx)
 * [15 years ago](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/#post-2098437)
 * I get that exact same error as well, just upgraded to 3.1.3.
 * Will follow along here, and post if I find any solution that doesn’t involve 
   touching the core.
 *  [Adam Harley (Kawauso)](https://wordpress.org/support/users/kawauso/)
 * (@kawauso)
 * [15 years ago](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/#post-2098441)
 * This is being discussed on Trac [#17556](http://core.trac.wordpress.org/ticket/17556)
   and will be fixed in 3.1.4. As far as I understand it, a change was backported
   that depended on one that wasn’t.
 *  [cabgfx](https://wordpress.org/support/users/cabgfx/)
 * (@cabgfx)
 * [15 years ago](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/#post-2098443)
 * Hmm, seems like the core team is aware of it – [Trac ticket](http://core.trac.wordpress.org/ticket/17556).
   Milestone is 3.1.4.
 * For anyone else having this problem:
    You can hide this warning with a flag in
   your .htaccess to suppress warnings & errors: `php_flag display_errors off`
 * Note: you probably want to keep this `on` in your development environment, but
   on your live site you should [hide errors for security measures.](http://perishablepress.com/press/2008/01/14/advanced-php-error-handling-via-htaccess/)
 *  [turkeyphant](https://wordpress.org/support/users/turkeyphant/)
 * (@turkeyphant)
 * [15 years ago](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/#post-2098513)
 * Same error here. What’s the eta for 3.1.4?
 *  [ericr23](https://wordpress.org/support/users/ericr23/)
 * (@ericr23)
 * [15 years ago](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/#post-2098530)
 * I got a similar error after I manually upgraded only the changed files. Manually
   upgrading all of the 3.1.3 package files (some of which were in fact changed 
   but not listed as such) fixed it.
 *  [jackmcdade](https://wordpress.org/support/users/jackmcdade/)
 * (@jackmcdade)
 * [15 years ago](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/#post-2098531)
 * Same here after an auto-update.
 *  [Tim Moore](https://wordpress.org/support/users/tmoorewp/)
 * (@tmoorewp)
 * [15 years ago](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/#post-2098533)
 * We likely won’t see 3.1.4 for this, but you can use the following plugin to clear
   up the error: [http://wordpress.org/extend/plugins/hotfix/](http://wordpress.org/extend/plugins/hotfix/)
 *  [Daya](https://wordpress.org/support/users/daya/)
 * (@daya)
 * [15 years ago](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/#post-2098574)
 * **In English :**
    You can correct this error 😉 Edit the file _query.php_ on 
   directory _wp-includes_ of WordPress : replace :
 *     ```
       if ( isset($q['post_status']) && $q['post_status'] != '' ) {
       			$statuswheres = array();
       			$q_status = explode(',', $q['post_status']);
       ```
   
 * by it :
 *     ```
       if ( ! empty( $q['post_status'] ) ) {
       			$statuswheres = array();
       			$q_status = $q['post_status'];
       			if ( ! is_array( $q_status ) )
       				$q_status = explode(',', $q_status);
       ```
   
 * **In French / en Français : **
    Vous pouvez corriger cette erreur 😉 Editez le
   fichier _query.php_ dans le dossier _wp-includes_ de WordPress : remplacez :
 *     ```
       if ( isset($q['post_status']) && $q['post_status'] != '' ) {
       			$statuswheres = array();
       			$q_status = explode(',', $q['post_status']);
       ```
   
 * par ça :
 *     ```
       if ( ! empty( $q['post_status'] ) ) {
       			$statuswheres = array();
       			$q_status = $q['post_status'];
       			if ( ! is_array( $q_status ) )
       				$q_status = explode(',', $q_status);
       ```
   
 * Enjoy xD
 *  [hugoBrizuela](https://wordpress.org/support/users/hugobrizuela/)
 * (@hugobrizuela)
 * [15 years ago](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/#post-2098576)
 * I had the same problem.
    Maya addressed the issue in a very ellegant way. Thanks
   Maya.
 *  [Donald McIntyre](https://wordpress.org/support/users/donmcint/)
 * (@donmcint)
 * [15 years ago](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/#post-2098577)
 * Daya, merci beaucoup!!
 * Warning: explode() expects parameter 2 to be string, array given in /home/donmcint/
   linkedbees.com/wp-includes/query.php on line 2390
 * Warning: in_array() expects parameter 2 to be array, null given in /home/donmcint/
   linkedbees.com/wp-includes/query.php on line 2399
 * Warning: in_array() expects parameter 2 to be array, null given in /home/donmcint/
   linkedbees.com/wp-includes/query.php on line 2399
 * Warning: in_array() expects parameter 2 to be array, null given in /home/donmcint/
   linkedbees.com/wp-includes/query.php on line 2399
 * Warning: in_array() expects parameter 2 to be array, null given in /home/donmcint/
   linkedbees.com/wp-includes/query.php on line 2399
 * Warning: in_array() expects parameter 2 to be array, null given in /home/donmcint/
   linkedbees.com/wp-includes/query.php on line 2399
 * Warning: in_array() expects parameter 2 to be array, null given in /home/donmcint/
   linkedbees.com/wp-includes/query.php on line 2399
 * Warning: in_array() expects parameter 2 to be array, null given in /home/donmcint/
   linkedbees.com/wp-includes/query.php on line 2399
 * Warning: in_array() expects parameter 2 to be array, null given in /home/donmcint/
   linkedbees.com/wp-includes/query.php on line 2399
 *  Thread Starter [unrelatedmedia](https://wordpress.org/support/users/unrelatedmedia/)
 * (@unrelatedmedia)
 * [15 years ago](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/#post-2098579)
 * Now, both Daya and I use the same principle to solve the problem, with 2 different
   approaches. The question remains – does this actually solve the issue or have
   any adverse effects?
 *  [ron jesser](https://wordpress.org/support/users/ron-jesser/)
 * (@ron-jesser)
 * [15 years ago](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/#post-2098580)
 * @Tim- that plug-in worked perfectly. Thanks!
 *  [sunnre](https://wordpress.org/support/users/sunnre/)
 * (@sunnre)
 * [15 years ago](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/#post-2098594)
 * Could there potentionally be a problem with using Daya’s solution?
 *  [INTERBOOST](https://wordpress.org/support/users/interboost/)
 * (@interboost)
 * [15 years ago](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/#post-2098598)
 * [@daya](https://wordpress.org/support/users/daya/)
 * now the problem is in german available under
 * [http://www.wordpress-studio.de/wordpress-news/2011/05/fehler-beim-update-auf3-1-3.html](http://www.wordpress-studio.de/wordpress-news/2011/05/fehler-beim-update-auf3-1-3.html)
 *  [JustinFYI](https://wordpress.org/support/users/justinfyi/)
 * (@justinfyi)
 * [15 years ago](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/#post-2098606)
 * The hotfix plugin resolved it for me as well ([http://wordpress.org/extend/plugins/hotfix/](http://wordpress.org/extend/plugins/hotfix/)).
   Thanks Tim.

Viewing 15 replies - 1 through 15 (of 28 total)

1 [2](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/page/2/?output_format=md)

The topic ‘[UPDATE Error]wp-includes/query.php array line 2390’ is closed to new
replies.

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 28 replies
 * 26 participants
 * Last reply from: [Andrew Nacin](https://wordpress.org/support/users/nacin/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/update-errorwp-includesqueryphp-array-line-2390/page/2/#post-2098681)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
