wp_set_comment_status

動作鉤子
do_action( 'wp_set_comment_status', $comment->comment_ID, 'delete' )

wp_set_comment_status是一個WordPress函式,用於設定評論的狀態。它接受兩個引數:評論ID和評論狀態。評論狀態可以是”approve”、”hold”、”spam”或”trash”。函式更新評論的狀態,並觸發對應的鉤子,如transition_comment_status。

這個動作在wp-includes/comment.php中有記錄。

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

常見問題

FAQs
檢視更多 >