woocommerce_rest_insert_product_review
Fires after a single item is created or updated via the REST API.
Usage
add_action( 'woocommerce_rest_insert_product_review', 'wp_kama_woocommerce_rest_insert_product_review_action', 10, 3 ); /** * Function for `woocommerce_rest_insert_product_review` action-hook. * * @param WP_Comment $product_review Inserted object. * @param WP_REST_Request $request Request object. * @param boolean $creating True when creating item, false when updating. * * @return void */ function wp_kama_woocommerce_rest_insert_product_review_action( $product_review, $request, $creating ){ // action... }
- $product_review(WP_Comment)
- Inserted object.
- $request(WP_REST_Request)
- Request object.
- $creating(true|false)
- True when creating item, false when updating.
Where the hook is called
woocommerce_rest_insert_product_review
woocommerce_rest_insert_product_review
woocommerce_rest_insert_product_review
woocommerce_rest_insert_product_review
woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-product-reviews-v1-controller.php 319
do_action( "woocommerce_rest_insert_product_review", $product_review, $request, true );
woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-product-reviews-v1-controller.php 367
do_action( "woocommerce_rest_insert_product_review", $product_review, $request, true );
woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-product-reviews-controller.php 488
do_action( 'woocommerce_rest_insert_product_review', $review, $request, true );
woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-product-reviews-controller.php 600
do_action( 'woocommerce_rest_insert_product_review', $review, $request, false );