delete_{$meta_type}_metadata

过滤钩子


apply_filters( "delete_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $delete_all )
参数
  • (null|bool)
    $delete
    Whether to allow metadata deletion of the given type.
    Required:
  • (int)
    $object_id
    ID of the object metadata is for.
    Required:
  • (string)
    $meta_key
    Metadata key.
    Required:
  • (mixed)
    $meta_value
    Metadata value. Must be serializable if non-scalar.
    Required:
  • (bool)
    $delete_all
    Whether to delete the matching metadata entries
    for all objects, ignoring the specified $object_id.
    Default false.
    Required:
定义位置
  • wp-includes/meta.php
    , line 425
引入
3.1.0
弃用

删除特定类型的元数据的捷径。

钩子名称的动态部分,$meta_type,指的是元对象类型(文章、评论、术语、用户,或任何其他有相关元表的类型)。返回一个非空值将有效地使该函数短路。

可能的钩子名称包括。

  • delete_post_metadata
  • delete_comment_metadata
  • delete_term_metadata
  • delete_user_metadata
$check = apply_filters( "delete_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $delete_all );