WC_API_Orders::item_is_null( array $item )
Helper method to check if the resource ID associated with the provided item is null
Description Description
Items can be deleted by setting the resource ID to null
Parameters Parameters
- $item
-
(Required) item provided in the request body
Return Return
(bool) true if the item resource ID is null, false otherwise
Source Source
File: includes/legacy/api/v2/class-wc-api-orders.php
protected function item_is_null( $item ) {
$keys = array( 'product_id', 'method_id', 'title', 'code' );
foreach ( $keys as $key ) {
if ( array_key_exists( $key, $item ) && is_null( $item[ $key ] ) ) {
return true;
}
}
return false;
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.2 | Introduced. |