[UPDATE Error]wp-includes/query.php 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?
- The topic ‘[UPDATE Error]wp-includes/query.php array line 2390’ is closed to new replies.