ACF\Meta
Option::get_meta
Retrieves all ACF meta for the provided object ID.
Method of the class: Option{}
No Hooks.
Returns
Array.
Usage
$Option = new Option(); $Option->get_meta( $object_id ): array;
- $object_id(int|string)
- The ID of the object to get meta from.
Changelog
| Since 6.4 | Introduced. |
Option::get_meta() Option::get meta code ACF 6.8.8
public function get_meta( $object_id = 0 ): array {
$all_meta = acf_get_option_meta( $object_id );
$meta = array();
foreach ( $all_meta as $key => $value ) {
// If a reference exists for this value, add it to the meta array.
if ( isset( $all_meta[ $this->reference_prefix . $key ] ) ) {
$meta[ $key ] = $value[0];
$meta[ $this->reference_prefix . $key ] = $all_meta[ $this->reference_prefix . $key ][0];
}
}
// Return results.
return $meta;
}