trashed_comment

動作鉤子
do_action( 'trashed_comment', $comment->comment_ID, $comment )
引數
  • (string) $comment_id The comment ID as a numeric string.
    Required:
  • (WP_Comment) $comment The trashed comment.
    Required:
定義位置
相關勾子
untrashed_commenttrash_commentuntrash_commentedit_commentdeleted_comment
相關方法
the_commentwp_trash_commentwp_untrash_commentedit_commenthave_commentscheck_comment
引入
4.9.0
棄用
-

trashed_comment – 這是一個WordPress的動作,當一個評論被移到垃圾桶時被觸發。trashed_comment動作是在評論剛剛被移到垃圾桶後觸發的,可以用來執行額外的動作,比如傳送電子郵件通知或更新其他資料。

在評論被送入回收站後立即觸發。

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

常見問題

FAQs
檢視更多 >