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 9.3.3

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;
	}
}