get_comment_type

過濾鉤子
apply_filters( 'get_comment_type', $comment->comment_type, $comment->comment_ID, $comment )
引數
  • (string) $comment_type The type of comment, such as 'comment', 'pingback', or 'trackback'.
    Required:
  • (string) $comment_ID The comment ID as a numeric string.
    Required:
  • (WP_Comment) $comment The comment object.
    Required:
定義位置
相關勾子
get_comment_textget_comment_dateget_comment_timeget_commentget_avatar_comment_types
相關方法
get_comment_typeget_comment_timeget_comment_textget_comment_datecomment_typeget_comment_meta
引入
4.1.0
棄用
-

get_comment_type 函式返回一個評論的型別。它接收一個評論物件作為引數,並返回一個表示評論型別的字串,如”comment”表示普通評論,”pingback”表示pingbacks。

過濾返回的評論型別。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
return apply_filters( 'get_comment_type', $comment->comment_type, $comment->comment_ID, $comment );
return apply_filters( 'get_comment_type', $comment->comment_type, $comment->comment_ID, $comment );
return apply_filters( 'get_comment_type', $comment->comment_type, $comment->comment_ID, $comment );

常見問題

FAQs
檢視更多 >