Field::add_error( string $code, string $message = '' )
Description #
Add error message to a field.
Parameters #
- $codestring (Required) Error code.
- $messagestring (Optional) Error message. Default value: ''
Source #
File: lib/form/class-field.php
public function add_error( $code, $message = '' ) { $this->errors[ $code ] = $message; $name = explode( '.', ap_to_dot_notation( $this->form_name ) ); if ( is_array( $name ) ) { anspress()->get_form( $name[0] )->add_error( 'fields-error', __( 'Error found in fields, please check and re-submit', 'anspress-question-answer' ) ); } }
Expand full source code Collapse full source code View on GitHub: lib/form/class-field.php:397
Add your comment