rest_after_insert_comment

動作鉤子
do_action( 'rest_after_insert_comment', $comment, $request, true )
引數
  • (WP_Comment) $comment Inserted or updated comment object.
    Required:
  • (WP_REST_Request) $request Request object.
    Required:
  • (bool) $creating True when creating a comment, false when updating.
    Required:
定義位置
相關勾子
rest_pre_insert_commentrest_after_insert_attachmentrest_insert_commentrest_after_insert_userrest_after_insert_nav_menu_item
相關方法
wp_after_insert_postwp_insert_commentget_page_of_commentrest_filter_response_by_contextregister_widget_controlwp_filter_comment
引入
5.0.0
棄用
-

rest_after_insert_comment: 這是一個動作鉤子,在一個評論被插入到資料庫後被觸發。它可以用來在一個評論被新增後執行額外的動作。

在通過REST API建立或更新評論後完全觸發。

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

常見問題

FAQs
檢視更多 >