WordPress at a glance
filter is not described

auth_(object_type)_meta_(meta_key) filter-hook . WP 4.6.0

Filters whether the user is allowed to edit a specific meta key of a specific object type.

Return true to have the mapped meta caps from edit_{$object_type} apply.

The dynamic portion of the hook name, $object_type refers to the object type being filtered. The dynamic portion of the hook name, $meta_key, refers to the meta key passed to map_meta_cap().


add_filter( 'auth_(object_type)_meta_(meta_key)', 'filter_function_name_7225', 10, 6 );
function filter_function_name_7225( $allowed, $meta_key, $object_id, $user_id, $cap, $caps ){
	// filter...

	return $allowed;
Whether the user can add the object meta.
Default: false
The meta key.
Object ID.
User ID.
Capability name.
Array of the user's capabilities.

Список изменений

С версии 4.6.0 Введена.
С версии 3.3.0 As auth_post_meta_{$meta_key}.

Где вызывается хук

wp-includes/capabilities.php 349
$allowed = apply_filters( "auth_{$object_type}_meta_{$meta_key}", $allowed, $meta_key, $object_id, $user_id, $cap, $caps );

Где используется хук в ядре WordPress

wp-includes/meta.php 1359
add_filter( "auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}", $args['auth_callback'], 10, 6 );
wp-includes/meta.php 1361
add_filter( "auth_{$object_type}_meta_{$meta_key}", $args['auth_callback'], 10, 6 );
wp-includes/meta.php 1503
remove_filter( "auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}", $args['auth_callback'] );
wp-includes/meta.php 1505
remove_filter( "auth_{$object_type}_meta_{$meta_key}", $args['auth_callback'] );