acf_get_meta()
Returns an array of "ACF only" meta for the given post_id.
Хуки из функции
Возвращает
Массив.
Использование
acf_get_meta( $post_id );
- $post_id(разное)
- The post_id for this data.
Список изменений
| С версии 5.8.0 | Введена. |
Код acf_get_meta() acf get meta ACF 6.4.2
function acf_get_meta( $post_id = 0 ) {
// Allow filter to short-circuit load_value logic.
$null = apply_filters( 'acf/pre_load_meta', null, $post_id );
if ( $null !== null ) {
return ( $null === '__return_null' ) ? null : $null;
}
// Decode the $post_id for $type and $id.
$decoded = acf_decode_post_id( $post_id );
$instance = acf_get_meta_instance( $decoded['type'] );
$meta = array();
if ( $instance ) {
$meta = $instance->get_meta( $decoded['id'] );
}
/**
* Filters the $meta array after it has been loaded.
*
* @date 25/1/19
* @since 5.7.11
*
* @param array $meta The array of loaded meta.
* @param string $post_id The $post_id for this meta.
*/
return apply_filters( 'acf/load_meta', $meta, $post_id );
}