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

      I have created a piklist field to add custom taxonomy to a custom post type

      
      piklist('field', array(
              'type' => 'select'
              ,'field' => 'location_country'
      		,'label' => 'Country'
      		,'choices' => piklist(
      		  get_terms('location-country', array(
      			'hide_empty' => false
      		  ))
      		  ,array(
      			'term_id'
      			,'name'
      		  )
      		)
            ));

      The problem is that I can update the post’s taxonomy field on the quick edit, and that works perfectly. However when I select the taxonomy in my dropdown inside, it is not actually assigning the post to that particular term. Did I create the select field wrong that it is not saving correctly?

      I didn’t notice at first until I tried running a wp_query for each particular term. Only the ones that I set the taxonomy through the quick_edit appeared. All of the posts that I went into the post and select the dropdown, did not appear. The dropdowns do retain their value, so it is saving the value somewhere, just not as a term.

    • #3885
      Steve
      Keymaster

      @justin– You’re pretty close. This tutorial explains how to do this.

      Two things:
      1) You need to add 'scope' => 'taxonomy' to your field array. Since your field is on the post type page, Piklist thinks you want to save it as a custom field. The scope tells it where you want to save.

      2) Make sure your field name is the name of the taxonomy.

      Let us know if this gets it working.

    • #3890
      justin
      Member

      That works perfectly. Thanks for helping Steve.

    • #3891
      Steve
      Keymaster

      Great! Closing ticket.

Viewing 3 reply threads
  • The topic ‘Taxonomy in Quick edit is different than piklist field’ is closed to new replies.