Opened 12 years ago
Closed 8 years ago
#27330 closed defect (bug) (maybelater)
Custom post type disappears from menu editor after update/first install.
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.8.1 |
| Component: | Menus | Keywords: | reporter-feedback needs-testing |
| Focuses: | administration | Cc: |
Description
To reproduce the bug:
- Get clean 3.8.1 installation
- Edit functions.php of 2014 theme and add at the end:
add_action( 'init', 'vocabulary_register_post_type' );
function vocabulary_register_post_type() {
$labels = array(
'name' => 'Słowniczek',
'singular_name' => 'Pojęcie',
'menu_name' => 'Pojęcia',
'name_admin_bar' => 'Pojęcie',
'add_new' => 'Dodaj nowe pojęcie',
'add_new_item' => 'Dodaj nowe pojęcie',
'edit_item' => 'Edytuj pojęcie',
'new_item' => 'Nowe pojęcie',
'view_item' => 'Wyswietl pojęcie',
'all_items' => 'Wszystkie pojęcia',
'search_items' => 'Wyszukaj pojęcia',
'parent_item_colon' => 'Nadrzędne książki',
'not_found' => 'Pojęć nie znaleziono',
'not_found_in_trash' => 'Brak usuniętych pojęć'
);
$product_args = array(
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'vocabulary' ),
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),
'labels' => $labels
);
register_post_type( 'vocabulary', $product_args );
}
(thats just a sample code from my project)
- Install wp, get into admin, go to Appearance -> Menus
- Check "Screen options" - custom post type "Slowniczkek" is hidden.
Now same process but:
- Get clean 3.8.1 installation
- Install wp, get into admin, go to Appearance -> Menus
- Edit functions.php of 2014 theme and add the registering process at the end of functions.php
- Reload Appearance -> Menus - custom post type "Slowniczek" is visible.
It looks like same problem (with hiding custom post types) happens while updating to 3.8.1
Change History (5)
#1
@
12 years ago
- Component changed from General to Menus
- Focuses administration added; template removed
- Keywords reporter-feedback added
#2
@
12 years ago
The problem still exist in 3.9.2.
Scenario A:
- I have downloaded 3.9.2 and installed (bit didn't log in).
- I have modified functions.php of twentyfourteen template with given code.
- I have logged in and checked Appearance -> Menus. Custom Post Type was hidden in screen options.
Scenario B:
- I have downloaded 3.9.2, installed and logged in (or simply deleted the database of previous installation and removed changes in twentyfourteen template).
- I have entered Appearance -> Menus - obviously Custom Post Type was ot there.
- I have made the modification to functions.php adding Custom Post Type
- I have reloaded Appearance -> Menus page - Custom Post Type was visible.
Note: See
TracTickets for help on using
tickets.
Hi CyberSpy, thanks for the report.
I was unable to reproduce this in the latest trunk and/or 3.9.1.
In both scenarios, the section for the new post type was hidden — which I believe is the expected default behavior, though I don't precisely remember where that logic lives.
Are you still seeing this issue?