Warning: This function has been deprecated. Use get_comment() instead.

get_commentdata() WordPress Function

The get_commentdata() function is used to get the data for a comment from the database. This function takes one argument, the comment ID, and returns an array of data for the comment. The data includes the comment ID, comment author, comment author email, comment author URL, comment date, comment date GMT, comment content, comment karma, and comment approved.

get_commentdata( int $comment_ID, int $no_cache, bool $include_unapproved = false ) #

Retrieve an array of comment data about comment $comment_ID.


Description

Top ↑

See also


Top ↑

Parameters

$comment_ID

(int)(Required)The ID of the comment

$no_cache

(int)(Required)Whether to use the cache (cast to bool)

$include_unapproved

(bool)(Optional)Whether to include unapproved comments

Default value: false


Top ↑

Return

(array) The comment data


Top ↑

Source

File: wp-includes/deprecated.php

function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) {
	_deprecated_function( __FUNCTION__, '2.7.0', 'get_comment()' );
	return get_comment($comment_ID, ARRAY_A);
}


Top ↑

Changelog

Changelog
VersionDescription
2.7.0Use get_comment()
0.71Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More