Definition:
function delete_post_meta($post_id, $meta_key, $meta_value = '') {}
Remove metadata matching criteria from a post.
You can match based on the key, or key and value. Removing based on key and value, will keep from removing duplicate metadata with the same key. It also allows removing all metadata matching key, if needed.
Parameters
- int $post_id: post ID
- string $meta_key: Metadata name.
- mixed $meta_value: Optional. Metadata value.
Return values
returns:False for failure. True for success.
Source code
function delete_post_meta($post_id, $meta_key, $meta_value = '') { // make sure meta is added to the post, not a revision if ( $the_post = wp_is_post_revision($post_id) ) $post_id = $the_post; return delete_metadata('post', $post_id, $meta_key, $meta_value); }
806
No comments yet... Be the first to leave a reply!