Automattic\WooCommerce\Internal\DataStores\StockNotifications
StockNotificationsDataStore::delete
Delete a stock notification.
Method of the class: StockNotificationsDataStore{}
No Hooks.
Returns
null. Nothing (null).
Usage
$StockNotificationsDataStore = new StockNotificationsDataStore(); $StockNotificationsDataStore->delete( $notification, $args );
- $notification(Notification) (required) (passed by reference — &)
- The data object to delete.
- $args(array)
- Additional arguments.
Default: array()
StockNotificationsDataStore::delete() StockNotificationsDataStore::delete code WC 10.3.6
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() );
}
}