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)
This ticket was mentioned in PR #636 on WordPress/wordpress-develop by carlomanf.
6 years ago
#1
- Keywords has-patch added
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
https://core.trac.wordpress.org/ticket/51582
Fixes https://core.trac.wordpress.org/ticket/51582
Trac ticket: https://core.trac.wordpress.org/ticket/51582