Automattic\WooCommerce\EmailEditor\Validator
Validation_Exception::create_from_wp_error
Creates a new instance of the exception.
Method of the class: Validation_Exception{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = Validation_Exception::create_from_wp_error( $wp_error ): self;
- $wp_error(WP_Error) (required)
- WP_Error instance.
Validation_Exception::create_from_wp_error() Validation Exception::create from wp error code WC 10.5.0
public static function create_from_wp_error( WP_Error $wp_error ): self {
$exception = self::create()
->withMessage( $wp_error->get_error_message() );
$exception->wp_error = $wp_error;
return $exception;
}