rest_product_review_trashable filter-hookWC 1.0

Filter whether a product review is trashable.

Return false to disable trash support for the product review.

Usage

add_filter( 'rest_product_review_trashable', 'wp_kama_rest_product_review_trashable_filter', 10, 2 );

/**
 * Function for `rest_product_review_trashable` filter-hook.
 * 
 * @param boolean $supports_trash Whether the object supports trashing.
 * @param WP_Post $product_review The object being considered for trashing support.
 *
 * @return boolean
 */
function wp_kama_rest_product_review_trashable_filter( $supports_trash, $product_review ){

	// filter...
	return $supports_trash;
}
$supports_trash(true|false)
Whether the object supports trashing.
$product_review(WP_Post)
The object being considered for trashing support.

Where the hook is called

WC_REST_Product_Reviews_V1_Controller::delete_item()
rest_product_review_trashable
woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-product-reviews-v1-controller.php 400
$supports_trash = apply_filters( 'rest_product_review_trashable', ( EMPTY_TRASH_DAYS > 0 ), $product_review );

Where the hook is used in WooCommerce

Usage not found.