Make WordPress Core

Opened 11 years ago

Closed 7 years ago

#27330 closed defect (bug) (maybelater)

Custom post type disappears from menu editor after update/first install.

Reported by: cyberspy's profile CyberSpy 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:

  1. Get clean 3.8.1 installation
  2. 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)

  1. Install wp, get into admin, go to Appearance -> Menus
  2. Check "Screen options" - custom post type "Slowniczkek" is hidden.

Now same process but:

  1. Get clean 3.8.1 installation
  2. Install wp, get into admin, go to Appearance -> Menus
  3. Edit functions.php of 2014 theme and add the registering process at the end of functions.php
  4. 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 @DrewAPicture
11 years ago

  • Component changed from General to Menus
  • Focuses administration added; template removed
  • Keywords reporter-feedback added

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?

#2 @CyberSpy
11 years ago

The problem still exist in 3.9.2.

Scenario A:

  1. I have downloaded 3.9.2 and installed (bit didn't log in).
  2. I have modified functions.php of twentyfourteen template with given code.
  3. I have logged in and checked Appearance -> Menus. Custom Post Type was hidden in screen options.

Scenario B:

  1. I have downloaded 3.9.2, installed and logged in (or simply deleted the database of previous installation and removed changes in twentyfourteen template).
  2. I have entered Appearance -> Menus - obviously Custom Post Type was ot there.
  3. I have made the modification to functions.php adding Custom Post Type
  4. I have reloaded Appearance -> Menus page - Custom Post Type was visible.

#3 @SergeyBiryukov
11 years ago

  • Summary changed from Custom post type disapears from menu editor after update/first install. to Custom post type disappears from menu editor after update/first install.

#4 @chriscct7
9 years ago

  • Keywords needs-testing added

#5 @welcher
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to maybelater
  • Status changed from new to closed

No movement in 2 years closing this out. Anyone can bring it back if needed.

Note: See TracTickets for help on using tickets.