ACF\Pro\Meta

WooOrder::get_valuepublicACF 6.4

Retrieves a field value from the database.

Method of the class: WooOrder{}

No Hooks.

Returns

Mixed.

Usage

$WooOrder = new WooOrder();
$WooOrder->get_value( $object_id, $field );
$object_id(int|string)
The ID of the object the metadata is for.
$field(array)
The field array.
Default: array()

Changelog

Since 6.4 Introduced.

WooOrder::get_value() code ACF 6.8.8

public function get_value( $object_id = 0, array $field = array() ) {
	$order = wc_get_order( $object_id );

	if ( ! $order || ! $order->meta_exists( $field['name'] ) ) {
		return null;
	}

	return $order->get_meta( $field['name'], true, 'edit' );
}