Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsListTable::set_review_product()protectedWC 1.0

Sets the product to filter reviews by.

Метод класса: ReviewsListTable{}

No Hooks.

Return

null. Nothing.

Usage

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

Code of ReviewsListTable::set_review_product() WC 7.1.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;
	}
}