age_gate_error_{$field}

You are reading the documentation for Age Gate 2.x. Switch to the documentation for 3.x.

Description

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;

  }
}

Changelog

  • Added: 2.0.0