wp_insert_comment

動作鉤子
do_action( 'wp_insert_comment', $id, $comment )
引數
  • (int) $id The comment ID.
    Required:
  • (WP_Comment) $comment Comment object.
    Required:
定義位置
相關勾子
rest_insert_commentrest_pre_insert_commentwp_count_commentswp_set_comment_statuswp_list_comments_args
相關方法
wp_insert_commentwp_list_commentswp_new_commentwp_filter_commentwp_insert_attachmentwp_insert_post
引入
2.8.0
棄用
-

wp_insert_comment: 這個函式在資料庫中插入一個新的評論。該評論被新增到評論表中,並與一個文章或一個頁面相關聯。

在一個評論被插入資料庫後立即觸發。

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

常見問題

FAQs
檢視更多 >