codearachnid/wp-subordinate-post — pull request #1 by MZAWeb (2012-09-04 05:10:36+00:00)
Title: Add custom rewrite rules

Create the necessary rewrites to load child posts in urls like:
%parent_post_type_slug%/%parent_post_slug%/%child_slug%

It works both for defining rewrite=true or rewrite=array('slug'=>'my_slug') for parents CPTs.

It stores a hash in options of the last rewrites created, so it flushes the rewrite rules only when needed.