From 53fef65d65c5c2e17afbd64568da609b903495a9 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 8 Jul 2014 18:46:56 +0000 Subject: [PATCH] Add a `create_wp_error` action which is called when a `WP_Error` instance is created. Fixes #28319. Props ebinnion git-svn-id: https://develop.svn.wordpress.org/trunk@29033 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-error.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/wp-includes/class-wp-error.php b/src/wp-includes/class-wp-error.php index 2e384d0fe2..c73e22b794 100644 --- a/src/wp-includes/class-wp-error.php +++ b/src/wp-includes/class-wp-error.php @@ -63,6 +63,15 @@ class WP_Error { if ( ! empty($data) ) $this->error_data[$code] = $data; + + /** + * Fires when a WP_Error object instance is created. + * + * @since 4.0.0 + * + * @param WP_Error $this The WP_Error instance. + */ + do_action( 'create_wp_error', $this ); } /**