Title: Error message: Undefined array key &#8220;default&#8221;
Last modified: December 20, 2023

---

# Error message: Undefined array key “default”

 *  Resolved [Andreas](https://wordpress.org/support/users/stylingagenten/)
 * (@stylingagenten)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/error-message-undefined-array-key-default/)
 * Hi, I got the error message “Undefined array key “default” in file: /public_html/
   wp-includes/class-wp-list-util.php on line 170
 * The row 170 is:
 * $newlist[ $key ] = $value[ $field ];
 * In this part of the script:
 *     ```wp-block-code
       /**
       	 * 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 $index_key is set, an array of found values with keys
       	 *               corresponding to $index_key. If $index_key is null, array keys from the original
       	 *               $list 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;
       				} elseif ( is_array( $value ) ) {
       					$newlist[ $key ] = $value[ $field ];
       				} else {
       					_doing_it_wrong(
       						__METHOD__,
       						__( 'Values for the input array must be either objects or arrays.' ),
       						'6.2.0'
       					);
       				}
       			}
   
       			$this->output = $newlist;
   
       			return $this->output;
       		}
   
       		/*
       		 * When index_key is not set for a particular item, push the value
       		 * to the end of the stack. This is how array_column() behaves.
       		 */
       		foreach ( $this->output as $value ) {
       			if ( is_object( $value ) ) {
       				if ( isset( $value->$index_key ) ) {
       					$newlist[ $value->$index_key ] = $value->$field;
       				} else {
       					$newlist[] = $value->$field;
       				}
       			} elseif ( is_array( $value ) ) {
       				if ( isset( $value[ $index_key ] ) ) {
       					$newlist[ $value[ $index_key ] ] = $value[ $field ];
       				} else {
       					$newlist[] = $value[ $field ];
       				}
       			} else {
       				_doing_it_wrong(
       					__METHOD__,
       					__( 'Values for the input array must be either objects or arrays.' ),
       					'6.2.0'
       				);
       			}
       		}
   
       		$this->output = $newlist;
   
       		return $this->output;
       	}
       ```
   
 * Do you know what the issue can be?
 * Thanks!
 * Andreas
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ferror-message-undefined-array-key-default%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [2 years, 5 months ago](https://wordpress.org/support/topic/error-message-undefined-array-key-default/#post-17292823)
 * Hi there!
 * Have you tried deactivating all plugins to see if that resolves the issue yet?
   That’s the first thing I would do. Sounds like a plugin is trying to use that
   class or a function that is using the class so it is creating that error. If 
   that does resolve the issue, you would want to activate one plugin at a time 
   to see which one is causing that.
 *  Thread Starter [Andreas](https://wordpress.org/support/users/stylingagenten/)
 * (@stylingagenten)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/error-message-undefined-array-key-default/#post-17293892)
 * Thanks, I found out that the error starts when I activate the plugin “Free shipping
   label”. Thanks for your help!
 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [2 years, 5 months ago](https://wordpress.org/support/topic/error-message-undefined-array-key-default/#post-17294637)
 * Happy to hear you were able to figure out where that was coming from.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Error message: Undefined array key “default”’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/error-message-undefined-array-key-default/#post-17294637)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
