Jump to content

wordpress invalid argument in foreach (line 1702)


sqlnoob

Recommended Posts

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 )
                                        ) );
                                }
                        }
                }
  • 3 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.