• 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 / get_comment_meta() – Retrieve comment meta field for a comment.

You appear to be a bot. Output may be restricted

Description

Retrieve comment meta field for a comment.

Usage

$mixed = get_comment_meta( $comment_id, $key, $single );

Parameters

$comment_id
( int ) required – Comment ID.
$key
( string ) optional – Optional. The meta key to retrieve. By default, returns data for all keys.
$single
( bool ) optional – Optional. Whether to return a single value. This parameter has no effect if $key is not specified. Default false.

Returns

mixed An array if $single is false. The value of meta data field if $single is true. False for an invalid $comment_id.

Source

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

1 to 3 of 3
function get_comment_meta( $comment_id, $key = '', $single = false ) {
  return get_metadata( 'comment', $comment_id, $key, $single );
}
 

 View on GitHub View on Trac

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

Primary Sidebar

Information

Function name: get_comment_meta
Plugin ref: WordPress
Version: 5.6
Sourcefile: wp-includes/comment.php
File ref: wp-includes/comment.php
Deprecated?: No
API Letters: C,G,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