Tagged: taxonomy field
- This topic has 7 replies, 2 voices, and was last updated 6 years, 8 months ago by
Steve.
-
AuthorPosts
-
-
June 13, 2015 at 12:11 pm #3860
nickcouplandMemberHello,
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
-
June 13, 2015 at 2:28 pm #3861
SteveKeymasterWelcome 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.
-
June 13, 2015 at 3:42 pm #3862
nickcouplandMemberThanks 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
-
June 13, 2015 at 5:25 pm #3863
SteveKeymasterPlease post your taxonomy code.
-
June 13, 2015 at 6:31 pm #3864
nickcouplandMemberHere it is. Thanks so much for your help.
-
June 15, 2015 at 10:13 am #3869
SteveKeymasterThe 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.
-
June 15, 2015 at 11:34 am #3874
nickcouplandMemberThat did the trick. Thank you so much for your help and thank you for the continuing work on PikList.
-
June 15, 2015 at 11:37 am #3875
SteveKeymasterYou’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
-
-
AuthorPosts
- The topic ‘Scope taxonomy not working’ is closed to new replies.