Opened 5 years ago
Last modified 5 years ago
#51582 new defect (bug)
Post type archive is loaded when post type does not allow
| Reported by: |
|
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)
This ticket was mentioned in PR #636 on WordPress/wordpress-develop by carlomanf.
5 years ago
#1
- Keywords has-patch added
Note: See
TracTickets for help on using
tickets.
https://core.trac.wordpress.org/ticket/51582
Fixes https://core.trac.wordpress.org/ticket/51582
Trac ticket: https://core.trac.wordpress.org/ticket/51582