woocommerce_rest_pre_insert_{$this->post_type}_object

woocommerce_rest_pre_insert_{$this->post_type}_object

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_rest_pre_insert_{$this->post_type}_object') is found 9 times:

  • /includes/rest-api/Controllers/Version2/class-wc-rest-coupons-v2-controller.php line 324
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
         * @param WC_Data         $coupon   Object object.
         * @param WP_REST_Request $request  Request object.
         * @param bool            $creating If is creating a new object.
         */
        return apply_filters( "woocommerce_rest_pre_insert_{$this->post_type}_object", $coupon, $request, $creating );
    }
     
    /**
     * Get the Coupon's schema, conforming to JSON Schema.
     *
     * @return array
  • /includes/rest-api/Controllers/Version2/class-wc-rest-order-refunds-v2-controller.php line 328
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    * @param WC_Data         $coupon   Object object.
     * @param WP_REST_Request $request  Request object.
     * @param bool            $creating If is creating a new object.
     */
    $refund = apply_filters( "woocommerce_rest_pre_insert_{$this->post_type}_object", $refund, $request, $creating );
     
    // If the filtered result is not a WC_Data instance and is not a WP_Error then something went wrong, but we
    // still need to honor the declared return type.
    return Types::ensure_instance_of(
        $refund,
        WC_Data::class,
  • /includes/rest-api/Controllers/Version2/class-wc-rest-orders-v2-controller.php line 777
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
         * @param bool            $creating If is creating a new object.
         *
         * @since 4.5.0.
         */
        return apply_filters( "woocommerce_rest_pre_insert_{$this->post_type}_object", $order, $request, $creating );
    }
     
    /**
     * Save an object data.
     *
     * @since  3.0.0
  • /includes/rest-api/Controllers/Version2/class-wc-rest-product-variations-v2-controller.php line 520
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
         * @param WC_Data         $variation Object object.
         * @param WP_REST_Request $request   Request object.
         * @param bool            $creating  If is creating a new object.
         */
        return apply_filters( "woocommerce_rest_pre_insert_{$this->post_type}_object", $variation, $request, $creating );
    }
     
    /**
     * Clear caches here so in sync with any new variations.
     *
     * @param WC_Data $object Object data.
  • /includes/rest-api/Controllers/Version2/class-wc-rest-products-v2-controller.php line 1298
    1294
    1295
    1296
    1297
    1298
    1299
    1300
    1301
    1302
    1303
    1304
         * @param WC_Data         $product  Object object.
         * @param WP_REST_Request $request  Request object.
         * @param bool            $creating If is creating a new object.
         */
        return apply_filters( "woocommerce_rest_pre_insert_{$this->post_type}_object", $product, $request, $creating );
    }
     
    /**
     * Set product images.
     *
     * @param WC_Product $product Product instance.
  • /includes/rest-api/Controllers/Version3/class-wc-rest-order-refunds-controller.php line 88
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
         * @param WC_Data         $coupon   Object object.
         * @param WP_REST_Request $request  Request object.
         * @param bool            $creating If is creating a new object.
         */
        return apply_filters( "woocommerce_rest_pre_insert_{$this->post_type}_object", $refund, $request, $creating );
    }
     
    /**
     * Get the refund schema, conforming to JSON Schema.
     *
     * @return array
  • /includes/rest-api/Controllers/Version3/class-wc-rest-orders-controller.php line 172
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
         * @param WC_Data         $order    Object object.
         * @param WP_REST_Request $request  Request object.
         * @param bool            $creating If is creating a new object.
         */
        return apply_filters( "woocommerce_rest_pre_insert_{$this->post_type}_object", $order, $request, $creating );
    }
     
    /**
     * Create or update a line item, overridden to add COGS data as needed.
     *
     * @param array  $posted Line item data.
  • /includes/rest-api/Controllers/Version3/class-wc-rest-product-variations-controller.php line 413
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
         * @param WC_Data         $variation Object object.
         * @param WP_REST_Request $request   Request object.
         * @param bool            $creating  If is creating a new object.
         */
        return apply_filters( "woocommerce_rest_pre_insert_{$this->post_type}_object", $variation, $request, $creating );
    }
     
    /**
     * Get the image for a product variation.
     *
     * @param WC_Product_Variation $variation Variation data.
  • /includes/rest-api/Controllers/Version3/class-wc-rest-products-controller.php line 1017
    1013
    1014
    1015
    1016
    1017
    1018
    1019
    1020
    1021
    1022
    1023
         * @param WC_Data         $product  Object object.
         * @param WP_REST_Request $request  Request object.
         * @param bool            $creating If is creating a new object.
         */
        return apply_filters( "woocommerce_rest_pre_insert_{$this->post_type}_object", $product, $request, $creating );
    }
     
    /**
     * Get the Product's schema, conforming to JSON Schema.
     *
     * @return array