• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress core a2z

WordPress core a2z

WordPress core only

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / delete_comment_meta() – Remove metadata matching criteria from a comment.

You appear to be a bot. Output may be restricted

Description

Remove metadata matching criteria from a comment.

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.

Usage

$bool = delete_comment_meta( $comment_id, $meta_key, $meta_value );

Parameters

$comment_id
( int ) required – Comment ID.
$meta_key
( string ) required – Metadata name.
$meta_value
( mixed ) optional – Optional. Metadata value. If provided, rows will only be removed that match the value. Must be serializable if non-scalar. Default empty.

Returns

bool True on success, false on failure.

Source

File name: wordpress/wp-includes/comment.php
Lines:

1 to 3 of 3
function delete_comment_meta( $comment_id, $meta_key, $meta_value = '' ) {
  return delete_metadata( 'comment', $comment_id, $meta_key, $meta_value );
}
 

 View on GitHub View on Trac

Published: 25th November 2019 | Last updated: 25th November 2019

Primary Sidebar

Information

Function name: delete_comment_meta
Plugin ref: WordPress
Version: 5.6
Sourcefile: wp-includes/comment.php
File ref: wp-includes/comment.php
Deprecated?: No
API Letters: C,D,M

Footer

WP-a2z
WordPress core a2z
WordPress core only
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  core.wp-a2z.org
© Copyright WP-a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites