I've been struggling with a quite specific point. I registered some custom post types and specified the rewrite slug for each one of them.
'rewrite' => array( 'slug' => 'my-slug' ),
But later when i'm trying to use the "rewrite slug" and to find which post_type is requested I cannot use the get_post_type() function : the post_type isn't recognized from the rewrite slug.
get_post_type( 'my-slug' )
Does anyone have an elegant solution to find a post_type from its rewrite slug ?