ACF\Meta
MetaLocation::get_value
Retrieves a field value from the database.
Method of the class: MetaLocation{}
No Hooks.
Returns
mixed.
Usage
$MetaLocation = new MetaLocation(); $MetaLocation->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. |
MetaLocation::get_value() MetaLocation::get value code ACF 6.8.8
public function get_value( $object_id = 0, array $field = array() ) {
$meta = get_metadata( $this->location_type, $object_id, $field['name'] );
return $meta[0] ?? null;
}