WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана


NoticeHandler::convert_notices_to_exceptions() public WC 1.0

Convert queued error notices into an exception.

For example, Payment methods may add error notices during validate_fields call to prevent checkout. Since we're not rendering notices at all, we need to convert them to exceptions.

This method will find the first error message and thrown an exception instead. Discards notices once complete.

{} Это метод класса: NoticeHandler{}

Хуков нет.


Null. Ничего.


$result = NoticeHandler::convert_notices_to_exceptions( $error_code );
Error code for the thrown exceptions.
По умолчанию: 'unknown_server_error'

Код NoticeHandler::convert_notices_to_exceptions() WC 4.7.1

public static function convert_notices_to_exceptions( $error_code = 'unknown_server_error' ) {
	if ( 0 === wc_notice_count( 'error' ) ) {

	$error_notices = wc_get_notices( 'error' );

	// Prevent notices from being output later on.

	foreach ( $error_notices as $error_notice ) {
		throw new RouteException( $error_code, $error_notice['notice'], 400 );