WC_Data::error()
When invalid data is found, throw an exception unless reading from the DB.
Метод класса: WC_Data{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->error( $code, $message, $http_status_code, $data );
- $code(строка) (обязательный)
- Error code.
- $message(строка) (обязательный)
- Error message.
- $http_status_code(int)
- HTTP status code.
По умолчанию: 400 - $data(массив)
- Extra error data.
По умолчанию: array()
Список изменений
С версии 3.0.0 | Введена. |
Код WC_Data::error() WC Data::error WC 9.7.1
protected function error( $code, $message, $http_status_code = 400, $data = array() ) { throw new WC_Data_Exception( $code, $message, $http_status_code, $data ); }