acf_determine_internal_post_type()ACF 1.0

Tries to determine the ACF post type for the provided key.

Хуков нет.

Возвращает

Строку|true|false.

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

acf_determine_internal_post_type( $key );
$key(строка) (обязательный)
The key to check.

Код acf_determine_internal_post_type() ACF 6.4.2

function acf_determine_internal_post_type( $key ) {
	$store      = acf_get_store( 'internal-post-types' );
	$post_types = array();

	if ( $store ) {
		$post_types = $store->get();
		$post_types = array_keys( $post_types );
	}

	foreach ( $post_types as $post_type ) {
		if ( acf_is_internal_post_type_key( $key, $post_type ) ) {
			return $post_type;
		}
	}

	return false;
}