I'm trying to connect a custom post type to a taxonomy defined in an other custom post type.
I'll show you an example. I have a custom post type COURSE, i use this post type to create a class for a university, so in this post type i'll have some custom field (teacher, lesson schedule ecc ecc) and a taxonomy called Teacher.
Teacher is an other custom post type i use to represent teachers working in my university.
Now i would like to create a link between the Teacher instance and the Course, so while i'm creating a new course i will have the list of ALL teachers in the university and i can chose one (or more) from this list.
How can i do that, should i define this list of teachers while i'm registering the taxonomy Teacher? Can you give me some code snippet to create this kind of association?
IMPORTANT: i'm looking for a code answer, i don't need a plugin, i want to learn how to create a code to do that.
Thanks in advance.
term
to theteachers
taxonomy everytime you creaet ateacher
post. Thats's not a nice option :( 2 - Hook thesave_post
action and programatically create a newterm
in theteacher
taxonomy matching a newly createdteacher
post. Look here to get started - codex.wordpress.org/Plugin_API/Action_Reference/save_post - have a bash, post your results above as an update and me & others on here will help you going forward. – David Gard Jan 21 '15 at 13:50