Retrieves comment meta field for a comment.
Parameters
$comment_idintrequired- Comment ID.
$keystringoptional- The meta key to retrieve. By default, returns data for all keys.
Default:
'' $singlebooloptional- Whether to return a single value.
This parameter has no effect if$keyis 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