WC_API_Orders::item_is_null() protected WC 2.2
Helper method to check if the resource ID associated with the provided item is null
Items can be deleted by setting the resource ID to null
{} Это метод класса: WC_API_Orders{}
Хуков нет.
Возвращает
true/false. true if the item resource ID is null, false otherwise
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->item_is_null( $item );
- $item(массив) (обязательный)
- item provided in the request body
Список изменений
С версии 2.2 | Введена. |
Код WC_API_Orders::item_is_null() WC API Orders::item is null WC 5.0.0
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;
}