Retrieves comment meta field for a comment.
Parameters
$comment_id
intrequired- Comment ID.
$key
stringoptional- The meta key to retrieve. By default, returns data for all keys.
Default:
''
$single
booloptional- Whether to return a single value.
This parameter has no effect if$key
is not specified.
Default:
false
Source
function get_comment_meta( $comment_id, $key = '', $single = false ) {
return get_metadata( 'comment', $comment_id, $key, $single );
}
Changelog
Version | Description |
---|---|
2.9.0 | Introduced. |
Basic Example