Title: auth_post_{$post_type}_meta_{$meta_key}
Published: August 16, 2016

---

# apply_filters( “auth_post_{$post_type}_meta_{$meta_key}”, bool $allowed, string $meta_key, int $post_id, int $user_id, string $cap, array $caps )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/auth_post_post_type_meta_meta_key/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/auth_post_post_type_meta_meta_key/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/auth_post_post_type_meta_meta_key/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/hooks/auth_post_post_type_meta_meta_key/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/auth_post_post_type_meta_meta_key/?output_format=md#wp--skip-link--target)

Filters whether the user is allowed to add post meta to a post of a given type.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/auth_post_post_type_meta_meta_key/?output_format=md#description)󠁿

The dynamic portions of the hook name, `$meta_key` and `$post_type`, refer to the
meta key passed to [map_meta_cap()](https://developer.wordpress.org/reference/functions/map_meta_cap/)
and the post type, respectively.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/auth_post_post_type_meta_meta_key/?output_format=md#parameters)󠁿

 `$allowed`bool

Whether the user can add the post meta. Default false.

`$meta_key`string

The meta key.

`$post_id`int

Post ID.

`$user_id`int

User ID.

`$cap`string

Capability name.

`$caps`array

User capabilities.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/auth_post_post_type_meta_meta_key/?output_format=md#source)󠁿

[View all references](https://developer.wordpress.org/reference/files/wp-includes/capabilities.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/capabilities.php#L285)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/capabilities.php#L285-L285)

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/auth_post_post_type_meta_meta_key/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fauth_post_post_type_meta_meta_key%2F)
before being able to contribute a note or feedback.