rest_insert_comment хук-событие . WP 4.7.0
Fires after a comment is created or updated via the REST API.
Использование
add_action( 'rest_insert_comment', 'action_function_name_2650', 10, 3 ); function action_function_name_2650( $comment, $request, $creating ){ // action... }
- $comment(WP_Comment)
- Inserted or updated comment object.
- $request(WP_REST_Request)
- Request object.
- $creating(true/false)
- True when creating a comment, false when updating.
Список изменений
С версии 4.7.0 | Введена. |
Где вызывается хук
rest_insert_comment
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php 725
do_action( 'rest_insert_comment', $comment, $request, true );
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php 889
do_action( 'rest_insert_comment', $comment, $request, false );