函数原型
is_avatar_comment_type( string $comment_type ): bool
函数描述
Check if this comment type allows avatars to be retrieved.
是否弃用
未弃用
函数参数
-
$comment_type
string
Required - Comment type to check.
函数返回值
bool Whether the comment type is allowed for retrieving avatars.
函数位置
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 );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 5.1.0 | Introduced. |

