• Hi!
    Can somebody assist me with this error that is coming up on my site?

    Warning: Undefined property: stdClass::$plugin in /home/bqgfvegddx3b/public_html/bananasgame.co.uk/wp-includes/class-wp-list-util.php on line 166

    THis is what line 166 is saying: “$newlist[ $key ] = $value->$field;”

    and the line 166 in context:

    /**
    	 * Plucks a certain field out of each object in the list.
    	 *
    	 * 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 from the object to place instead of the entire object
    	 * @param int|string $index_key Optional. Field from the object 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.
    			 */
    			foreach ( $this->output as $key => $value ) {
    				if ( is_object( $value ) ) {
    					$newlist[ $key ] = $value->$field;
    				} else {
    					$newlist[ $key ] = $value[ $field ];
    				}
    			}

    Thank you very much!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Undefined property: stdClass…class-wp-list-util.php’ is closed to new replies.