acf_get_internal_post_type_post()ACF 6.1

Gets a post object from an ACF internal post type.

Хуков нет.

Возвращает

Объект|true|false. The post object, or false on failure.

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

acf_get_internal_post_type_post( $id, $post_type );
$id(int|строка) (обязательный)
The post ID, key, or name.
$post_type(строка) (обязательный)
The post type name.

Список изменений

С версии 6.1 Введена.

Код acf_get_internal_post_type_post() ACF 6.4.2

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

	if ( ! $instance ) {
		return false;
	}

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