Last active
December 14, 2015 08:19
-
-
Save mjangda/5057113 to your computer and use it in GitHub Desktop.
Sanitize callback that treats data as HTML.
This file contains 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 | |
function x_custom_metadata_sanitize_as_html( $field_slug, $field, $object_type, $object_id, $value ) { | |
if ( is_array( $value ) ) | |
$value = array_map( 'wp_filter_post_kses', $value ); | |
else | |
$value = wp_filter_post_kses( $value ); | |
return $value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment