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.9.8.1

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
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    * @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
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
         * @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 );
    }