Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sanitize callback that treats data as HTML.
<?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
You can’t perform that action at this time.