Tagged: ,

Viewing 3 reply threads
  • Author
    Posts
    • #4572
      justin
      Member

      In all of my custom post types I can no longer change or select a taxonomy. It shows me what was selected before the upgrade, but I can no longer modify the seletions. When I click save, it says saved correctly, but it never actually saves the new selection. In one I have check box as the option, and the other is a select field.

      Did the scope method change in the upgrade?

      Example:

      piklist('field', array(
          'type' => 'checkbox'
          ,'scope' => 'taxonomy'
          ,'field' => 'trip-type'
          ,'label' => 'Trip Type'
          ,'choices' => piklist(
            get_terms('trip-type', array(
              'hide_empty' => false
            ))
            ,array(
              'term_id'
              ,'name'
            )
          )
        ));

      Here is my created Taxonomy from my main plugin file:

      $taxonomies[] = array(
            'post_type' => 'post_mission_trip'
            ,'name' => 'trip-type'
            ,'show_admin_column' => true
            ,'hide_meta_box' => false
            ,'configuration' => array(
              'hierarchical' => false
              ,'labels' => piklist('taxonomy_labels', 'Trip Type')
              ,'show_ui' => true
              ,'query_var' => true
              ,'rewrite' => array( 
                'slug' => 'trip-type' 
              )
            )
          );
    • #4581
      Steve
      Keymaster

      @justin

      By setting 'show_ui' => true, WordPress is rendering the taxonomy field twice. You will also have to add 'meta_box_cb' => false, which stops WordPress from rendering the default meta box.

      OR… I’m going to let you in on a little secret.

      The latest version of Piklist 0.9.9.x, makes it super easy for you to REPLACE the default Taxonomy meta box with your own.

      We call it extending a section, or EXTEND.

      Just add this to the comment block of the file that the taxonomy checkbox is in:

      Extend: tagsdiv-trip-type
      Extend Method: replace
      

      By adding this you’re telling Piklist to replace the div with ID tagsdiv-trip-type, which is the default WP meta box.

      When we officially release 0.9.9 we’ll formally announce this feature.

      Also, WordPress doesn’t like hyphens in taxonomies names. Check out the first parameter in register_taxonomy.

    • #4585
      justin
      Member

      Thank you that fixed it. I also updated my taxonomy to not have the dashes.

      Thanks for the hint on the extend. It is just suppose to make the entire metabox’s id tagsdiv-trip-type? Well what ever it was suppose to do I can wait until your documentation come out. I can update my taxonomies now.

      Solved

    • #4586
      Steve
      Keymaster

      Great! Closing ticket.

Viewing 3 reply threads
  • The topic ‘Can not modify taxonomy of posts [0.9.9.2]’ is closed to new replies.