acf_validation::add_error │ public │ ACF 5.0.0

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.8.8

function add_error( $input, $message ) {

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