WordPress at Your Fingertips
filter is not described

sanitize_(object_type)_meta_(meta_key)_for_(object_subtype) filter-hook . WP 4.9.8

Filters the sanitization of a specific meta key of a specific meta type and subtype.

The dynamic portions of the hook name, $object_type, $meta_key, and $object_subtype, refer to the metadata object type (comment, post, term, or user), the meta key value, and the object subtype respectively.


add_filter( 'sanitize_(object_type)_meta_(meta_key)_for_(object_subtype)', 'filter_function_name_9660', 10, 4 );
function filter_function_name_9660( $meta_value, $meta_key, $object_type, $object_subtype ){
	// filter...

	return $meta_value;
Metadata value to sanitize.
Metadata key.
Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', or any other object type with an associated meta table.
Object subtype.

Where the hook is called

wp-includes/meta.php 1216
return apply_filters( "sanitize_{$object_type}_meta_{$meta_key}_for_{$object_subtype}", $meta_value, $meta_key, $object_type, $object_subtype );

Where in WP core the hook is used WordPress

wp-includes/meta.php 1359
add_filter( "sanitize_{$object_type}_meta_{$meta_key}_for_{$object_subtype}", $args['sanitize_callback'], 10, 4 );
wp-includes/meta.php 1504
remove_filter( "sanitize_{$object_type}_meta_{$meta_key}_for_{$object_subtype}", $args['sanitize_callback'] );