Automattic\WooCommerce\Internal\StockNotifications

Notification::set_product_id │ public │ WC 1.0

Set the product ID.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$Notification = new Notification();
$Notification->set_product_id( $product_id );
$product_id(int) (обязательный)
Product ID.

Код Notification::set_product_id() WC 11.3.0

public function set_product_id( int $product_id ) {

	// Reset runtime cache if the product ID has changed.
	if ( is_a( $this->product, 'WC_Product' ) && $product_id !== $this->product->get_id() ) {
		$this->product = null;
	}
	$this->set_prop( 'product_id', $product_id );
}