I've got my permalinks for a Custom Post Type set to /%custom_taxonomy%/%postname%/ using the Custom Post Type Permalink Plugin to set the custom rules for this CPT.
What this gives me is site.com/cpt/term/sub-term/postname. Yes the post is in the sub-term.
What I want is site.com/cpt/term/postname, so eliminate the sub-term from the permalink.
Looking at this question Remove child category from URL and then the code https://core.trac.wordpress.org/browser/tags/3.9.1/src/wp-includes/link-template.php#L169 you can see that the CPT's don't get to the same filter. CPT's use get_post_permalink here: https://core.trac.wordpress.org/browser/tags/3.9.1/src/wp-includes/link-template.php#L244
That only leaves me with the post_type_link filter.
How would I achieve site.com/cpt/term/postname?