Warning: Invalid argument for foreach() ..\class-wp-list-util.php on line 165
-
Warning: Invalid argument supplied for foreach() in D:\home\site\wwwroot\wp-includes\class-wp-list-util.php on line 165
I’m getting this warning in the header area of my site. The warning is inconsistent on the pages of the site.
I’m running this on a WordPress network/multisite. No other users are reporting this warning appearing. Turning off the theme seems to rid of the warning but as I mentioned, it’s inconsistent./** * Plucks a certain field out of each element in the input array. * * This has the same functionality and prototype of * array_column() (PHP 5.5) but also supports objects. * * @since 4.7.0 * * @param int|string $field Field to fetch from the object or array. * @param int|string $index_key Optional. Field from the element to use as keys for the new array. * Default null. * @return array Array of found values. If <code>$index_key</code> is set, an array of found values with keys * corresponding to <code>$index_key</code>. If <code>$index_key</code> is null, array keys from the original * <code>$list</code> will be preserved in the results. */ public function pluck( $field, $index_key = null ) { $newlist = array(); if ( ! $index_key ) { /* * This is simple. Could at some point wrap array_column() * if we knew we had an array of arrays. */ ///Line 165 next foreach ( $this->output as $key => $value ) { if ( is_object( $value ) ) { $newlist[ $key ] = $value->$field; } else { $newlist[ $key ] = $value[ $field ]; } } $this->output = $newlist; return $this->output; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Warning: Invalid argument for foreach() ..\class-wp-list-util.php on line 165’ is closed to new replies.