Make WordPress Core

Opened 6 years ago

Last modified 6 years ago

#51582 new defect (bug)

Post type archive is loaded when post type does not allow

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

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.