Changeset 49022 for trunk/src/wp-includes/class-wp-error.php
- Timestamp:
- 09/20/2020 05:43:00 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-error.php
r48586 r49022 57 57 } 58 58 59 $this->errors[ $code ][] = $message; 60 61 if ( ! empty( $data ) ) { 62 $this->error_data[ $code ] = $data; 63 } 59 $this->add( $code, $message, $data ); 64 60 } 65 61 … … 177 173 178 174 /** 179 * Add an error or appendadditional message to an existing error.175 * Adds an error or appends an additional message to an existing error. 180 176 * 181 177 * @since 2.1.0 … … 187 183 public function add( $code, $message, $data = '' ) { 188 184 $this->errors[ $code ][] = $message; 185 189 186 if ( ! empty( $data ) ) { 190 $this->error_data[ $code ] = $data; 191 } 187 $this->add_data( $data, $code ); 188 } 189 190 /** 191 * Fires when an error is added to a WP_Error object. 192 * 193 * @since 5.6.0 194 * 195 * @param string|int $code Error code. 196 * @param string $message Error message. 197 * @param mixed $data Error data. Might be empty. 198 * @param WP_Error $wp_error The WP_Error object. 199 */ 200 do_action( 'wp_error_added', $code, $message, $data, $this ); 192 201 } 193 202
Note: See TracChangeset
for help on using the changeset viewer.