wp-includes/class-wp-error.php:184Adds an error or appends an additional message to an existing error.
$codestring|int$messagestring$datamixedoptional''voidOne hook fires while WP_Error::add() runs, in this order:
Fires when an error is added to a WP_Error object.
public function add( $code, $message, $data = '' ) { $this->errors[ $code ][] = $message; if ( ! empty( $data ) ) { $this->add_data( $data, $code ); } /** * Fires when an error is added to a WP_Error object. * * @since 5.6.0 * * @param string|int $code Error code. * @param string $message Error message. * @param mixed $data Error data. Might be empty. * @param WP_Error $wp_error The WP_Error object. */ do_action( 'wp_error_added', $code, $message, $data, $this ); }Introduced in 2.1.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
none to void.verified against sourcesrc/wp-includes/class-wp-error.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.