Skip to content

Instantly share code, notes, and snippets.

@xnau
Last active January 30, 2017 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xnau/4c1596e85a014f1a8f8724bfdab90c65 to your computer and use it in GitHub Desktop.
Save xnau/4c1596e85a014f1a8f8724bfdab90c65 to your computer and use it in GitHub Desktop.
<?php
/**
* adds a custom validation error message
*
* @param array $error_messages
* @return array
*/
function xnau_add_url_validation_error_message( $error_messages )
{
// add our message with a placeholder for the field name
$error_messages['invalid url'] = 'You must provide a valid URL for the %s field.';
return $error_messages;
}
add_filter( 'pdb-validation_error_messages', 'xnau_add_url_validation_error_message' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment