A WordPress-centric search engine for devs and theme authors



auth_{$object_type}_meta_{$meta_key} ›

Since4.6.0
Deprecatedn/a
apply_filters( "auth_{$object_type}_meta_{$meta_key}", false, $meta_key, $object_id, $user_id, $cap, $caps )
Parameters: (6)
  • (bool) $allowed Whether the user can add the post meta. Default false.
    Required: Yes
  • (string) $meta_key The meta key.
    Required: Yes
  • (int) $post_id Post ID.
    Required: Yes
  • (int) $user_id User ID.
    Required: Yes
  • (string) $cap Capability name.
    Required: Yes
  • (array) $caps User capabilities.
    Required: Yes
Defined at:
Codex:

Filters whether the user is allowed to edit meta.

Use the {@see authpost$object_typemeta$metakey} filter to modify capabilities for specific object types. 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().





Source

$allowed = apply_filters( "auth_{$object_type}_meta_{$meta_key}", false, $meta_key, $object_id, $user_id, $cap, $caps );