wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



get_comment_guid › WordPress Function

Depuis2.5.0
Dépréciéen/a
get_comment_guid ( $comment_id = null )
Paramètres:
  • (int|WP_Comment) $comment_id Optional comment object or ID. Defaults to global comment object.
    Requis: Non
    Défaut: null
Retourne:
  • (string|false) GUID for comment on success, false on failure.
Défini(e) dans:
Codex:

Retrieves the feed GUID for the current comment.



Source

function get_comment_guid( $comment_id = null ) {
	$comment = get_comment( $comment_id );

	if ( ! is_object( $comment ) ) {
		return false;
	}

	return get_the_guid( $comment->comment_post_ID ) . '#comment-' . $comment->comment_ID;
}