Created
April 18, 2016 19:51
-
-
Save sbruner/183e6efd282c48e57c22a4c5d83961be to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// create a sanitization rule called "my_email_sanitization" | |
add_filter('piklist_sanitization_rules', 'sanitize_email_function', 11); | |
function sanitize_email_function($sanitization_rules) | |
{ | |
$sanitization_rules['my_email_sanitization'] = array( | |
'callback' => 'sanitize_email_callback' | |
); | |
return $sanitization_rules; | |
} | |
function sanitize_email_callback($value, $field, $options) | |
{ | |
return sanitize_email($value); // sanitize_email() is a core WordPress function | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment