Automattic\WooCommerce\EmailEditor\Validator

Validation_Exception::create_from_wp_error │ public static │ WC 1.0

Creates a new instance of the exception.

Метод класса: Validation_Exception{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = Validation_Exception::create_from_wp_error( $wp_error ): self;
$wp_error(WP_Error) (обязательный)
WP_Error instance.

Код Validation_Exception::create_from_wp_error() WC 11.2.2

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;
}