age_gate_error_{$field}

Allows customisation of individual error messages.

This filter takes two parameters:

  • $message: The default message for the error
  • $rule: The validation rule that has failed.

Example

Changing only the required message for the day input:

add_filter('age_gate_error_age_gate_d', 'my_day_message', 10, 2);

function my_day_message($message, $rule){
  switch($rule){
    case 'required':
      return 'You did not enter a day';
      break;
    default:
      return $message;

  }
}