acf_validation::add_errorpublicACF 5.0.0

add_error

This function will add an error message for a field

Method of the class: acf_validation{}

No Hooks.

Returns

$post_id. (int)

Usage

$acf_validation = new acf_validation();
$acf_validation->add_error( $input, $message );
$input(required)
.
$message(required)
.

Changelog

Since 5.0.0 Introduced.

acf_validation::add_error() code ACF 6.0.4

function add_error( $input, $message ) {

	// add to array
	$this->errors[] = array(
		'input'   => $input,
		'message' => $message,
	);

}