transition_comment_status

動作鉤子
do_action( 'transition_comment_status', $new_status, $old_status, $comment )
引數
  • (int|string) $new_status The new comment status.
    Required:
  • (int|string) $old_status The old comment status.
    Required:
  • (WP_Comment) $comment Comment object.
    Required:
定義位置
相關勾子
wp_set_comment_statusget_default_comment_statusrest_comment_trashabletrash_commentatom_comments_ns
相關方法
wp_transition_comment_status_transition_post_statuswp_transition_post_statuswp_set_comment_statusget_default_comment_statusget_comment_statuses
引入
2.7.0
棄用
-

transition_comment_status – 這是一個WordPress動作,當評論的狀態發生變化時被觸發。transition_comment_status動作是在評論狀態改變後才觸發的,可以用來執行額外的動作,如傳送電子郵件通知或更新其他資料。

當評論狀態處於過渡期時觸發。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
do_action( 'transition_comment_status', $new_status, $old_status, $comment );
do_action( 'transition_comment_status', $new_status, $old_status, $comment );
do_action( 'transition_comment_status', $new_status, $old_status, $comment );

常見問題

FAQs
檢視更多 >