Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsListTable::set_review_product()protectedWC 1.0

Sets the product to filter reviews by.

Method of the class: ReviewsListTable{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->set_review_product() : void;

ReviewsListTable::set_review_product() code WC 8.7.0

protected function set_review_product() : void {

	$product_id = isset( $_REQUEST['product_id'] ) ? absint( $_REQUEST['product_id'] ) : null;
	$product = $product_id ? wc_get_product( $product_id ) : null;

	if ( $product instanceof WC_Product ) {
		$this->current_product_for_reviews = $product;
	}
}