get_query_var(‘post_type’) not returning in a filter

If you are trying to get the post type for the current ‘post’, I think you could go with get_post_type().

Like this:

$post_type = get_post_type();

Try it out.