acf_get_internal_post_type()ACF 1.0

Get an ACF CPT object as an array

Хуков нет.

Возвращает

Массив|false. The post type object.

Использование

acf_get_internal_post_type( $id, $post_type );
$id(int) (обязательный)
The post ID being queried.
$post_type(строка) (обязательный)
The post type being queried.

Код acf_get_internal_post_type() ACF 6.4.2

function acf_get_internal_post_type( $id, $post_type ) {
	$instance = acf_get_internal_post_type_instance( $post_type );

	if ( ! $instance ) {
		return false;
	}

	return $instance->get_post( $id );
}