is_protected_meta
Filters whether a meta key is considered protected.
Usage
add_filter( 'is_protected_meta', 'wp_kama_is_protected_meta_filter', 10, 3 );
/**
* Function for `is_protected_meta` filter-hook.
*
* @param bool $protected Whether the key is considered protected.
* @param string $meta_key Metadata key.
* @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', 'user', or any other object type with an associated meta table.
*
* @return bool
*/
function wp_kama_is_protected_meta_filter( $protected, $meta_key, $meta_type ){
// filter...
return $protected;
}
- $protected(true|false)
- Whether the key is considered protected.
- $meta_key(string)
- Metadata key.
- $meta_type(string)
- Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', 'user', or any other object type with an associated meta table.
Changelog
| Since 3.2.0 | Introduced. |
Where the hook is called
is_protected_meta
wp-includes/meta.php 1326
return apply_filters( 'is_protected_meta', $protected, $meta_key, $meta_type );