Automattic\WooCommerce\Internal\ShopperLists
ShopperList::remove_item
Remove an item by key. Returns false if the key wasn't present.
Method of the class: ShopperList{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ShopperList = new ShopperList(); $ShopperList->remove_item( $key ): bool;
- $key(string) (required)
- Storage key of the item to remove.
ShopperList::remove_item() ShopperList::remove item code WC 10.9.1
public function remove_item( string $key ): bool {
if ( ! isset( $this->items[ $key ] ) ) {
return false;
}
unset( $this->items[ $key ] );
return true;
}