if ( empty( $object_subtype ) ) { $caps[] = 'do_not_allow';
break;
} $caps =
map_meta_cap( "edit_{
$object_type}",
$user_id,
$object_id );
$meta_key =
isset( $args[1
] ) ?
$args[1
] : false;
if ( $meta_key ) { $allowed = !
is_protected_meta( $meta_key,
$object_type );
if ( !
empty( $object_subtype ) &&
has_filter( "auth_{
$object_type}_meta_{
$meta_key}_for_{
$object_subtype}"
) ) { /**
* Filters whether the user is allowed to edit a specific meta key of a specific object 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.
*
* @since 4.9.8
*
* @param bool $allowed Whether the user can add the object meta. Default false.
* @param string $meta_key The meta key.
* @param int $object_id Object ID.
* @param int $user_id User ID.
* @param string $cap Capability name.
* @param string[] $caps Array of the user's capabilities.
*/