get_comment_guid

Retrieve the feed GUID for the current comment.

Description

(false|string) get_comment_guid( (constant) $comment_id = null ); 

Returns (false|string)

false on failure or guid for comment on success.

Parameters (1)

0. $comment_id — Optional. (constant) => null
Comment object or id. Defaults to global comment object.

Usage

  1. if ( !function_exists( 'get_comment_guid' ) ) { 
  2. require_once ABSPATH . WPINC . '/feed.php'; 
  3.  
  4. // Optional comment object or id. Defaults to global comment object. 
  5. $comment_id = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_comment_guid($comment_id); 
  9.  

Defined (1)

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

/wp-includes/feed.php  
  1. function get_comment_guid($comment_id = null) { 
  2. $comment = get_comment($comment_id); 
  3.  
  4. if ( !is_object($comment) ) 
  5. return false; 
  6.  
  7. return get_the_guid($comment->comment_post_ID) . '#comment-' . $comment->comment_ID;