Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#24385 closed defect (bug) (worksforme)

Adding and Deleting Custom Taxonomies not Working

Reported by: greeso's profile greeso Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5.1
Component: Taxonomy Keywords: reporter-feedback close
Focuses: Cc:

Description

I created a new post type and a new taxonomy as follows

/* Code to add new custom post type */
function aaa_register_post_type() {

	$post_type_labels = array(
		'name'					=> __('News'),
		'singular_name'			=> __('News Item'),
		'all_items'				=> __('All News'),
		'add_new'				=> __('Add New'),
		'add_new_item'			=> __('Add New News Item'),
		'edit_item'				=> __('Edit News Item'),
		'new_item'				=> __('New News Item'),
		'view_item'				=> __('View News Item'),
		'search_items'			=> __('Search News'),
		'not_found'				=> __('Nothing found'),
		'not_found_in_trash'	=> __('Nothing found in Trash'),
		'parent_item_colon'		=> ''
	);

	$post_type_args = array(
		'labels'				=> $post_type_labels,
		'description'			=> 'This post type is used for news posts from the RSS feeds.',
		'public'				=> true,
		'menu_position'			=> 5,
		'capability_type'		=> 'post',
		'hierarchical'			=> true,
		'supports'				=> array('title','editor', 'author', 'comments'),
		'rewrite'				=> array('slug')
	);

	register_post_type ('news', $post_type_args);
}

add_action('init', 'aaa_register_post_type', 0);





/* Register custom news category taxonomy */
function aaa_register_taxonomy_site () {

	$taxonomy_lables = array(
			'name'					=> __('Sites'),
			'singular_name'			=> __('Site'),
			'all_items'				=> __('All Sites'),
			'edit_item'				=> __('Edit Site'),
			'view_item'				=> __('View Site'),
			'update_item'			=> __('Update Site'),
			'add_new_item'			=> __('Add New Site'),
			'new_item_name'			=> __('New Site Name'),
			'parent_item'			=> __('Parent Site'),
			'parent_item_colon'		=> __('Parent Site:'),
			'search_items'			=> __('Search Sites'),
			'popular_items'			=> __('Popular Sites'),
			'not_found'				=> __('Nothing found'),
			'hierarchical'			=> true,
			'query_var'           	=> true
				
	);

	$taxonomy_args = array(
			'labels' 				=> $taxonomy_lables,
			'show_admin_column'		=> true,
			'hierarchical'			=> true
	);

	register_taxonomy("site", 'news', $taxonomy_args);
	
}

add_action('init', 'aaa_register_taxonomy_site');

Now to cause the error

  1. Click on the new custom post "News" menu in WordPress admin
  2. Click on the new custom taxonomy "Sites" submenu
  3. Create a new site, then click on the add site button, nothing happens. The list of sites is not updated and the site info is still in the text boxes. However, if you refresh the page, the new site is in the list.

Now, if you want to delete the site after refeshing the page: On the same list of sites page, hover over the site, and click on delete, and you get an undefined error.

Change History (12)

#1 @SergeyBiryukov
11 years ago

  • Keywords reporter-feedback added

Could not reproduce with your code on a clean install. Adding and deleting terms in "Sites" taxonomy works correctly for me.

#2 @wonderboymusic
11 years ago

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

No feedback in 3 months from reporter

#3 @SergeyBiryukov
11 years ago

  • Resolution changed from invalid to worksforme

#4 @greeso
11 years ago

I received the first email notification about this track now. So I apologize for not replying earlier.

I still get the incorrect behavior. I have a clean install as well. I still have to refresh the page manually to update the list of new taxonomies.

#5 @greeso
11 years ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened

#6 @jeremyfelt
11 years ago

Works fine for me in current trunk using Chrome 28.0.1500.95 on Twenty Fourteen with no plugins installed.

@greeso - Can you provide more details on browser and WordPress version?

#7 @greeso
11 years ago

I am using WordPres 3.5.1 on FireFox 22.0

Currently I do have a number of plugins installed, however at the time of reporting this bug, no plugins were present. Moreover, those plugins that are activated did not change the behavior I described above.

#8 @SergeyBiryukov
11 years ago

  • Milestone set to Awaiting Review

#9 @helen
11 years ago

Cannot reproduce in trunk, Firefox 22. Please try with no plugins and using a default theme, such as Twenty Twelve or Twenty Thirteen.

#10 @nacin
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from reopened to closed

Could you explain what "an undefined error" is?

#11 @greeso
11 years ago

After upgrading to the newest WordPress, and using a clean install, this is no longer valid.

#12 @greeso
11 years ago

  • Keywords close added
Note: See TracTickets for help on using tickets.