[wp-trac] [WordPress Trac] #24385: Adding and Deleting Custom Taxonomies not Working

WordPress Trac noreply at wordpress.org
Wed May 22 16:52:35 UTC 2013


#24385: Adding and Deleting Custom Taxonomies not Working
--------------------------+-----------------------------
 Reporter:  greeso        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  3.5.1
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 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.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24385>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list