Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers

ArrayValues::transform()publicWC 1.0

Search array value by one of its key.

Method of the class: ArrayValues{}

No Hooks.

Return

Mixed.

Usage

$ArrayValues = new ArrayValues();
$ArrayValues->transform( $value, $arguments, $default_value );
$value(mixed) (required)
a value to transform.
$arguments(stdClass|null)
arguments.
Default: null
$default_value(string|null)
default value.
Default: array()

ArrayValues::transform() code WC 9.0.1

public function transform( $value, stdClass $arguments = null, $default_value = array() ) {
	if ( ! is_array( $value ) ) {
		return $default_value;
	}

	return array_values( $value );
}