WooCommerce Code Reference

DimensionsInput
in package
Uses TracksProvidedFields

Input type for product dimensions.

Table of Contents

$height  : float|null
$length  : float|null
$weight  : float|null
$width  : float|null
$provided_fields  : array<string|int, mixed>
Fields that were explicitly provided in the input.
mark_provided()  : void
Mark a field as explicitly provided in the input.
was_provided()  : bool
Check whether a field was explicitly provided in the input.

Properties

$provided_fields

Fields that were explicitly provided in the input.

protected array<string|int, mixed> $provided_fields = array()

Using an underscore prefix to keep it invisible to the ApiBuilder (which only scans public properties for GraphQL fields).

Methods

mark_provided()

Mark a field as explicitly provided in the input.

public mark_provided(string $field) : void
Parameters
$field : string

The field name.

Return values
void

was_provided()

Check whether a field was explicitly provided in the input.

public was_provided(string $field) : bool
Parameters
$field : string

The field name.

Return values
bool