acf_get_internal_post_type_instance()
Gets an instance of an ACF_Internal_Post_Type.
Хуков нет.
Возвращает
ACF_Internal_Post_Type|true|false. The internal post type class instance, or false on failure.
Использование
acf_get_internal_post_type_instance( $post_type );
- $post_type(строка)
- The ACF internal post type to get the instance for.
По умолчанию:'acf-field-group'
Код acf_get_internal_post_type_instance() acf get internal post type instance ACF 6.4.2
function acf_get_internal_post_type_instance( $post_type = 'acf-field-group' ) {
$store = acf_get_store( 'internal-post-types' );
if ( ! $store ) {
return false;
}
$instance = $store->get( $post_type );
if ( ! $instance ) {
return false;
}
return acf_get_instance( $instance );
}