woocommerce_rest_insert_webhook_object

woocommerce_rest_insert_webhook_object

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

do_action('woocommerce_rest_insert_webhook_object') is found 2 times:

  • /includes/rest-api/Controllers/Version1/class-wc-rest-webhooks-v1-controller.php line 370
    		 * @param WC_Webhook      $webhook  Webhook data.
    		 * @param WP_REST_Request $request  Request object.
    		 * @param bool            $creating True when creating item, false when updating.
    		 */
    		do_action( 'woocommerce_rest_insert_webhook_object', $webhook, $request, true );
    
    		$request->set_param( 'context', 'edit' );
    		$response = $this->prepare_item_for_response( $webhook->get_id(), $request );
    		$response = rest_ensure_response( $response );
    		$response->set_status( 201 );
    		$response->header( 'Location', rest_url( sprintf( '/%s/%s/%d', $this->namespace, $this->rest_base, $webhook->get_id() ) ) );
    
  • /includes/rest-api/Controllers/Version1/class-wc-rest-webhooks-v1-controller.php line 450
    		 * @param WC_Webhook      $webhook  Webhook data.
    		 * @param WP_REST_Request $request  Request object.
    		 * @param bool            $creating True when creating item, false when updating.
    		 */
    		do_action( 'woocommerce_rest_insert_webhook_object', $webhook, $request, false );
    
    		$request->set_param( 'context', 'edit' );
    		$response = $this->prepare_item_for_response( $webhook->get_id(), $request );
    
    		return rest_ensure_response( $response );
    	}