Automattic\WooCommerce\Internal\PushNotifications\Notifications
StockNotification::write_meta
{@inheritDoc}
Метод класса: StockNotification{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$StockNotification = new StockNotification(); $StockNotification->write_meta( $key, ?int $timestamp ): void;
- $key(строка) (обязательный)
- The meta key.
- ?int $timestamp
- .
По умолчанию:null
Код StockNotification::write_meta() StockNotification::write meta WC 11.3.0
public function write_meta( string $key, ?int $timestamp = null ): void {
$product = WC()->call_function( 'wc_get_product', $this->get_resource_id() );
if ( $product instanceof WC_Product ) {
$product->update_meta_data( $this->meta_key( $key ), (string) ( $timestamp ?? time() ) );
$product->save_meta_data();
}
}