auth_{$object_type}_meta_{$meta_key}
apply_filters( “auth_{$object_type}_meta_{$meta_key}”, bool $allowed , string $meta_key , int $object_id , int $user_id , string $cap , string[] $caps )
筛选挂钩:筛选是否允许用户编辑特定对象类型的特定元键。
Filter Hook: Filters whether the user is allowed to edit a specific meta key of a specific object type.
说明(Description)
返回true以应用edit{$object{u type}中的映射元大写。
参数(Parameters)
参数 | 类型 | 说明 |
---|---|---|
$allowed | (bool) | 用户是否可以添加对象元。默认为false。 |
$meta_key | (string) | 元密钥。 |
$object_id | (int) | 对象ID。 |
$user_id | (int) | 用户ID。 |
$cap | (string) | 能力名称。 |
$caps | (string[]) | 用户能力的数组。 |
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
4.6.0 | wp-includes/capabilities.php:349 | 1 | 0 |
auth_{$object_type}_meta_{$meta_key} 为WP2原创文章,链接:https://www.wp2.cn/hook/auth_object_type_meta_meta_key/