Make WordPress Core

Opened 4 years ago

Last modified 4 years ago

#51582 new defect (bug)

Post type archive is loaded when post type does not allow

Reported by: manfcarlo's profile 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.