get_commentdata

Retrieve an array of comment data about comment $comment_ID.

Description

(array) get_commentdata( (int) $comment_ID, (int) $no_cache = 0, (bool) $include_unapproved = false ); 

Returns (array)

The comment data

Parameters (3)

0. $comment_id (int)
The ID of the comment
1. $no_cache — Optional. (int)
Whether to use the cache (cast to bool)
2. $include_unapproved — Optional. (bool) => false
Whether to include unapproved comments

Usage

  1. if ( !function_exists( 'get_commentdata' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // The ID of the comment 
  5. $comment_id = -1; 
  6.  
  7. // Whether to use the cache (cast to bool) 
  8. $no_cache = -1; 
  9.  
  10. // Whether to include unapproved comments 
  11. $include_unapproved = false; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = get_commentdata($comment_id, $no_cache, $include_unapproved); 
  15.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/deprecated.php  
  1. function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) { 
  2. _deprecated_function( __FUNCTION__, '2.7.0', 'get_comment()' ); 
  3. return get_comment($comment_ID, ARRAY_A);