acf_determine_internal_post_type()
Tries to determine the ACF post type for the provided key.
No Hooks.
Returns
String|true|false.
Usage
acf_determine_internal_post_type( $key );
- $key(string) (required)
- The key to check.
acf_determine_internal_post_type() acf determine internal post type code ACF 6.8.8
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;
}