is_avatar_comment_type

函式
is_avatar_comment_type ( $comment_type )
引數
  • (string) $comment_type Comment type to check.
    Required:
返回值
  • (bool) Whether the comment type is allowed for retrieving avatars.
定義位置
相關方法
get_comment_typecomment_type_wp_batch_update_comment_typeis_comment_feedget_comment_text
引入
5.1.0
棄用
-

is_avatar_comment_type: 這個函式檢查一個給定的評論型別是否是頭像評論型別。頭像評論型別是由WordPress自動生成的評論,以顯示作者的頭像。如果給定的評論型別是一個頭像評論型別,它返回真,否則返回假。

檢查該評論型別是否允許檢索頭像。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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 );
}
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 ); }
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 );
}

常見問題

FAQs
檢視更多 >