#26242 closed defect (bug) (invalid)
Customize page empty in a theme with 'theme' post type, very strange
| Reported by: | alexvorn2 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Customize | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
Steps to reproduce:
- Register theme post type
function codex_custom_init() {
$args = array(
'public' => true,
'label' => 'Themes'
);
register_post_type( 'theme', $args );
}
add_action( 'init', 'codex_custom_init' );
- Try to customize the theme wp-admin/customize.php
- Page is blank!
I can't understand what the problem can be..
Only these ids are reserved, not 'theme':
post
page
attachment
revision
nav_menu_item
Firefox latest, Windows 32bit, php 5.3.8
Change History (2)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
There are many more reserved post type names than that.. Those are the names which exist within the database, but there's a 2nd angle to it.
But registering a post_type with 'theme' and not including the query_var, it defaults to the post type slug 'theme'.
Since we use 'theme' as a query var for previewing, that's passed in the request, ie. "http://wordpress/src/?theme=some-theme-name", That causes WordPress to look for a post_type of theme with the slug 'some-theme-name', which will 404.
When the customizer 404's, it doesn't load the customize frame.
Ultimately, Prefix your things - That means post types too, 'my_themes' as a post type wouldn't have interfered.
(edit: Added a mention to the Codex's reserved post_type list)