WordPress.org

Make WordPress Core

Opened 4 months ago

#46283 new enhancement

Allow filtering post-type archive rewrites

Reported by: ethitter Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.1
Component: Posts, Post Types Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

If one wishes to introduce additional query arguments into a post-type archive's rewrite structure, the current options are rather cumbersome: filter the rewrites as they're generated, filter the whole rewrites array, or reproduce a considerable amount of logic from WP_Post_Type::add_rewrite_rules(). By introducing a few filters on the archive-specific rewrites, it becomes far easier to customize a post type's archive rewrites.

Attachments (1)

archive-slug-filters-with-test.patch (3.4 KB) - added by ethitter 4 months ago.

Download all attachments as: .zip

Change History (1)

Note: See TracTickets for help on using tickets.