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.