WordPress.org

Make WordPress Core

Opened 3 weeks ago

#44270 new defect (bug)

Non-public custom post types have rewrite rules enabled by default

Reported by: TheDeadMedic Owned by:
Milestone: Awaiting Review Priority: normal
Severity: trivial Version:
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

Is there a reason for the pairing of public => false with rewrite => true for default custom post type arguments? If there isn't can we change the default rewrite to inherit public at runtime?

I often see a large rewrite rules array from plugin/theme private post types not declaring rewrite => false - if there's no need for them seems bit of a waste - a default WP install is 17 rules per post type, 17 possible unnecessary regex checks per-request. Usually it's two or three CPTs I see per site and they stack up quick.

Change History (0)

Note: See TracTickets for help on using tickets.