Automattic\WooCommerce\EmailEditor\Validator
Validation_Exception::create_from_wp_error
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() 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;
}