sqlnoob Posted August 6, 2013 Share Posted August 6, 2013 Hi, Some woman did an update for her wordpress website. It may have changed or removed some files. I have no way of determining if that is so, because she can't tell me what update she made. The error I see is the following: Warning: Invalid argument supplied for foreach() in /usr/home/deb27616n2/domains/plezierinleven.nl/public_html/wp-includes/query.php on line 1702 This is all I know. She can't tell me anymore and she can't define or tell me what exactly she did and what update she performed. If someone has an easy answer for this, with a quick recode of that function. It be much appreciated, because I don't know where to look for. Whether it is a misreferenced variable, or a missing variable because a file has been deleted I don't know. The error is on line 1702 in the query.php file in the directory of wp-includes: foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) { if ( 'post_tag' == $taxonomy ) continue; // Handled further down in the $q['tag'] block if ( $t->query_var && !empty( $q[$t->query_var] ) ) { $tax_query_defaults = array( 'taxonomy' => $taxonomy, 'field' => 'slug', ); if ( isset( $t->rewrite['hierarchical'] ) && $t->rewrite['hierarchical'] ) { $q[$t->query_var] = wp_basename( $q[$t->query_var] ); } $term = $q[$t->query_var]; if ( strpos($term, '+') !== false ) { $terms = preg_split( '/[+]+/', $term ); foreach ( $terms as $term ) { $tax_query[] = array_merge( $tax_query_defaults, array( 'terms' => array( $term ) ) ); } } else { $tax_query[] = array_merge( $tax_query_defaults, array( 'terms' => preg_split( '/[,]+/', $term ) ) ); } } } Link to comment https://forums.phpfreaks.com/topic/280881-wordpress-invalid-argument-in-foreach-line-1702/ Share on other sites More sharing options...
trq Posted August 6, 2013 Share Posted August 6, 2013 The error is pretty clear. $GLOBALS['wp_taxonomies'] is not an array. You need to find where it is defined and fix it. Link to comment https://forums.phpfreaks.com/topic/280881-wordpress-invalid-argument-in-foreach-line-1702/#findComment-1443654 Share on other sites More sharing options...
sqlnoob Posted August 25, 2013 Author Share Posted August 25, 2013 thanks Link to comment https://forums.phpfreaks.com/topic/280881-wordpress-invalid-argument-in-foreach-line-1702/#findComment-1446705 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.