ACF\Meta
Option::get_meta
Retrieves all ACF meta for the provided object ID.
Метод класса: Option{}
Хуков нет.
Возвращает
Массив.
Использование
$Option = new Option(); $Option->get_meta( $object_id ): array;
- $object_id(int|строка)
- The ID of the object to get meta from.
Список изменений
| С версии 6.4 | Введена. |
Код Option::get_meta() Option::get meta ACF 6.4.2
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;
}