A WordPress-centric search engine for devs and theme authors



sanitize_meta ›

Since3.1.3
Deprecatedn/a
sanitize_meta ( $meta_key, $meta_value, $object_type )
Parameters: (3)
  • (string) $meta_key Meta key.
    Required: Yes
  • (mixed) $meta_value Meta value to sanitize.
    Required: Yes
  • (string) $object_type Type of object the meta is registered to.
    Required: Yes
Returns:
  • (mixed) Sanitized $meta_value.
Defined at:
Codex:

Sanitize meta value.



Source

function sanitize_meta( $meta_key, $meta_value, $object_type ) {
	/**
	 * Filters the sanitization of a specific meta key of a specific meta type.
	 *
	 * The dynamic portions of the hook name, `$meta_type`, and `$meta_key`,
	 * refer to the metadata object type (comment, post, or user) and the meta
	 * key value, respectively.
	 *
	 * @since 3.3.0
	 *
	 * @param mixed  $meta_value      Meta value to sanitize.
	 * @param string $meta_key        Meta key.
	 * @param string $object_type     Object type.
	 */
	return apply_filters( "sanitize_{$object_type}_meta_{$meta_key}", $meta_value, $meta_key, $object_type );
}