add_permastruct() should allow more control over WP_Rewrite::generate_rewrite_rules()
|Reported by:||dnxpert||Owned by:||John|
In wp-includes/rewrite.php the function rewrite_rules calls "generate_rewrite_rules" with default parameters when creating rules for extra_permastructs.
Hence, all extra_permastructs get rules for paging, feeds, walk dirs and all end points, and yet no rules for commenting.
This logic kind of renders the add_permastructs function pointless - it definitely forced me to add my "extra" permastructs manually by using one of the available filters in the rewrite_rules function - since I didn't want any of the rules generate_rewrite_rules creates by default - I only happened to want the comment paging rule.
Wouldn't the logical thing be to allow add_permastructs function callers to decide what rewrite rules they need for each extra permastruct they add?
Change History (7)
- Keywords has-patch added; extra permastructs rewrite removed
- Summary changed from default parameters used with generate_rewrite_rules for creating rules for extra_permastructs to add_permastruct() should allow more control over WP_Rewrite::generate_rewrite_rules()