Opened 14 years ago
Closed 14 years ago
#17176 closed defect (bug) (fixed)
WP_Rewrite::page_uri_index() includes auto-drafts
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 3.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Rewrite Rules | Keywords: | has-patch |
Focuses: | Cc: |
Description
The query results passed to get_page_hierarchy() includes auto-drafts. This means that when verbose page rules are in use there are several useless rewrite rules created:
()/trackback/?$ => index.php?pagename=$matches[1]&tb=1 ()/feed/(feed|rdf|rss|rss2|atom)/?$ => index.php?pagename=$matches[1]&feed=$matches[2] ()/(feed|rdf|rss|rss2|atom)/?$ => index.php?pagename=$matches[1]&feed=$matches[2] ()/page/?([0-9]{1,})/?$ => index.php?pagename=$matches[1]&paged=$matches[2] ()/comment-page-([0-9]{1,})/?$ => index.php?pagename=$matches[1]&cpage=$matches[2] ()(/[0-9]+)?/?$ => index.php?pagename=$matches[1]&page=$matches[2]
Steps:
- Visit add new page to create an auto-draft
- Go to options-permalinks.php and enable a verbose structure
Attachments (1)
Change History (6)
Note: See
TracTickets for help on using
tickets.
I *think* this query might actually scan fewer rows since it's able to use another element of the type_status_date KEY.