is_avatar_comment_type() WordPress Function

The is_avatar_comment_type() function is used to determine whether a comment is an avatar comment type. Avatar comments are those that have been left by a user who has an avatar image.

is_avatar_comment_type( string $comment_type ) #

Check if this comment type allows avatars to be retrieved.


Parameters

$comment_type

(string)(Required)Comment type to check.


Top ↑

Return

(bool) Whether the comment type is allowed for retrieving avatars.


Top ↑

Source

File: wp-includes/link-template.php

function is_avatar_comment_type( $comment_type ) {
	/**
	 * Filters the list of allowed comment types for retrieving avatars.
	 *
	 * @since 3.0.0
	 *
	 * @param array $types An array of content types. Default only contains 'comment'.
	 */
	$allowed_comment_types = apply_filters( 'get_avatar_comment_types', array( 'comment' ) );

	return in_array( $comment_type, (array) $allowed_comment_types, true );
}


Top ↑

Changelog

Changelog
VersionDescription
5.1.0Introduced.

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
Show More