WordPress.org

Make WordPress Core

Opened 5 weeks ago

Last modified 5 weeks ago

#51582 new defect (bug)

Post type archive is loaded when post type does not allow

Reported by: manfcarlo Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:

Description

If a post type is registered with 'has_archive' = false, it should not be possible to load an archive of its posts.

As per my testing, this can be fixed by unsetting WP::query_vars['post_type'] when WP::query_vars['name'] is empty and the post type does not allow archive.

Change History (1)

Note: See TracTickets for help on using tickets.