Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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