rest_product_review_trashable хук-фильтрWC 1.0

Filter whether a product review is trashable.

Return false to disable trash support for the product review.

Использование

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.

Где вызывается хук

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 380
$supports_trash = apply_filters( 'rest_product_review_trashable', ( EMPTY_TRASH_DAYS > 0 ), $product_review );

Где используется хук в WooCommerce

Использование не найдено.