• When trying to click the “Add New Equipment Type” button for my custom taxonomy, it simply moves the DOM element up into the list of entries and fails to add the actual term. Here is my taxonomy code:

    $labels = array(
        'name' => _x( 'Equipment Types', 'taxonomy general name' ),
        'singular_name' => _x( 'Equipment Type', 'taxonomy singular name' ),
        'search_items' =>  __( 'Search Equipment Types' ),
        'all_items' => __( 'All Equipment Types' ),
        'parent_item' => __( 'Parent Equipment Type' ),
        'parent_item_colon' => __( 'Parent Equipment Type:' ),
        'edit_item' => __( 'Edit Equipment Type' ),
        'update_item' => __( 'Update Equipment Type' ),
        'add_new_item' => __( 'Add New Equipment Type' ),
        'new_item_name' => __( 'New Equipment Type Name' ),
        'menu_name' => __( 'Equipment Type' ),
      );
    
      register_taxonomy('equipmenttype',array('powerequipment'), array(
        'hierarchical' => true,
        'labels' => $labels,
        'show_ui' => true,
        'query_var' => true,
        'rewrite' => array( 'slug' => 'power-equipment' ),
      ));

    Here’s a screenshot of the behavior:

    View post on imgur.com

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hey, hereswhatidid. Did you ever get this figured out? I’m having the exact problem If you did figure it out and can share the solution I would be very grateful!

    Thread Starter Gabe Shackle

    (@hereswhatidid)

    Haven’t gotten any responses yet both here and on the WordPress stack exchange. Appears to not be a very widespread problem but it’s nice knowing I’m not he only one.

    Bummer… Well I’ve got to get it figured out.. so if I do.. I’ll post what my issue was here. Keep your fingers crossed!

    Hey, I think you posted on another forum.. I saw your post there.. and someone posted an answer that worked for them and it worked for me as well. It appears some code is using some sort of “like” comparison. If your taxonomies are named with a prefix like the name of the post type they are in .. this seems to happen. I went through and renamed my taxonomies without the post type prefix.. and viola.. all is well!

    For example your taxonomy is named ‘equipmenttype’ .. is the post type the taxonomy used for called ‘equipment’ perhaps? If so.. I bet that’s what’s causing it. Anyway.. it was for me. Everything works as it should now. Hopefully this works for you as well… Good luck!

    Thread Starter Gabe Shackle

    (@hereswhatidid)

    This solves the issue. Turns out that having a custom taxonomy that begins with the same characters as a custom post type it will break the admin interface for that taxonomy on the Edit Post page.

    Changing the custom taxonomy name from ‘equipmenttype’ to ‘powequipmenttype’ fixed it.

    Bug?

    I just ran into this as well, but not with a taxonomy with the same name as the post type. The post type for me is “videos”, but the taxonomy was, again, “equipment”.

    Has “equipment” become a reserved word, intentionally or otherwise?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom taxonomy add button jumps’ is closed to new replies.