Automattic\WooCommerce\Internal\DataStores\StockNotifications
StockNotificationsDataStore::delete
Delete a stock notification.
Метод класса: StockNotificationsDataStore{}
Хуков нет.
Возвращает
void. Ничего (null).
Использование
$StockNotificationsDataStore = new StockNotificationsDataStore(); $StockNotificationsDataStore->delete( $notification, $args );
- $notification(Notification) (обязательный) (передается по ссылке — &)
- The data object to delete.
- $args(массив)
- Additional arguments.
По умолчанию:array()
Код StockNotificationsDataStore::delete() StockNotificationsDataStore::delete WC 11.2.2
public function delete( &$notification, $args = array() ) {
global $wpdb;
$deleted = $wpdb->delete( $this->get_table_name(), array( 'id' => $notification->get_id() ), array( '%d' ) );
if ( $deleted > 0 ) {
$this->data_store_meta->delete_by_notification_id( $notification->get_id() );
}
}