woocommerce_rest_(post_type)_object_trashable хук-фильтр . WC 1.0
Filter whether an object is trashable.
Return false to disable trash support for the object.
Использование
add_filter( 'woocommerce_rest_(post_type)_object_trashable', 'filter_function_name_6260', 10, 2 ); function filter_function_name_6260( $supports_trash, $object ){ // filter... return $supports_trash; }
- $supports_trash(true/false)
- Whether the object type support trashing.
- $object(WC_Data)
- The object being considered for trashing support.
Где вызывается хук
woocommerce_rest_(post_type)_object_trashable
woocommerce_rest_(post_type)_object_trashable
woocommerce_rest_(post_type)_object_trashable
woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-crud-controller.php 432
$supports_trash = apply_filters( "woocommerce_rest_{$this->post_type}_object_trashable", $supports_trash, $object );
woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-products-v2-controller.php 1554
$supports_trash = apply_filters( "woocommerce_rest_{$this->post_type}_object_trashable", $supports_trash, $object );
woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-product-variations-v2-controller.php 507
$supports_trash = apply_filters( "woocommerce_rest_{$this->post_type}_object_trashable", $supports_trash, $object );
Где используется хук в ядре WooCommerce
woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-order-refunds-v2-controller.php 53
add_filter( "woocommerce_rest_{$this->post_type}_object_trashable", '__return_false' );