Viewing 7 reply threads
  • Author
    Posts
    • #3860
      nickcoupland
      Member

      Hello,

      I have a custom post type that I have created with a custom taxonomy attached to it. I have created a meta box with a select field that pulls in all the terms from the custom tax which display correctly. The problem I am having is that when saving the post it doesn’t seem to save the correct data as the select field is just defaulting back to the first option once the page reloads.

      If I use post_meta as the scope everything works correctly however there is no relation between that data and the taxonomy which is no good for me. I used the exact code in the tutorial with the modifications I needed for my data.

      Is this a bug or is there something I am missing? I hope this all makes sense.

      Here is my code http://pastebin.com/eExhdadF

    • #3861
      Steve
      Keymaster

      Welcome to the Piklist community!

      Are you hiding the default meta box that WordPress creates for the taxonomy? You can’t have two identical fields on the same page. That’s just the way forms work.

      Lucky Piklist has you covered.

      Use the hide_meta_box parameter.

      Let us know if that works for you.

    • #3862
      nickcoupland
      Member

      Thanks for the response Steve,

      I am currently using the hide_meta_box parameter with still no luck. It hides the meta box as usual but the select field I have created still isn’t saving the taxonomy correctly. I have read a few threads similar to this but none offer a real solution.

      Thanks

    • #3863
      Steve
      Keymaster

      Please post your taxonomy code.

    • #3864
      nickcoupland
      Member

      Here it is. Thanks so much for your help.

      http://pastebin.com/LxEam887

    • #3869
      Steve
      Keymaster

      The field name has to match the taxonomy name so Piklist knows where to save the data. Change the field name and you should be fine:

      From this: 'field' => 'course_select',
      To this: 'field' => 'course_names',

      Let us know if you need any more help.

    • #3874
      nickcoupland
      Member

      That did the trick. Thank you so much for your help and thank you for the continuing work on PikList.

    • #3875
      Steve
      Keymaster

      You’re very welcome.

      If you have the time, a quick 5 star review on WordPress.org goes a long way for the project: https://wordpress.org/support/view/plugin-reviews/piklist?filter=5

Viewing 7 reply threads
  • The topic ‘Scope taxonomy not working’ is closed to new replies.