do_action( 'wp_error_added', string|int $code, string $message, mixed $data, WP_Error $wp_error )
- Since
- 5.6.0
Fires when an error is added to a WP_Error object.
Compatibility
- WordPress
- since 5.6.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$codestring|int- Error code.
$messagestring- Error message.
$datamixed- Error data. Might be empty.
$wp_errorWP_Error- The WP_Error object.
Where this hook fires · 1
wp-includes/class-wp-error.php:201WP_Error::add()
Source code
* * @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 ); } /** * Adds data to an error with the given code. * * @since 2.1.0Changelog
Introduced in 5.6.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.