4

I have 3 custom post types with Advanced Custom Fields:

  • Student
  • Class
  • Homework Assignment

Homework has a custom field that is a 'relationship' with Class. This is because specific pieces of homework are related to specific classes.

A Student has a relationship field with Class because each student is part of a class.

Now I want to create a Homework Assignment, so I set a custom field (relationship) of student. Once I've chosen a student, I want the 2nd custom field (also a relationship) to give me the choice of any Homework Assignment records that have the same class as the student.

So basically how do I have a conditional statement with Advanced Custom Fields that 'filters' instead of 'show/hides' the 2nd custom field?

3
  • 1
    What have you already tried? Showing your research and efforts is prerequisite to asking questions here. – kaiser Aug 13 '13 at 21:37
  • 1
    And have you tried their support forums? – kaiser Aug 14 '13 at 2:33
  • ACF can do what you're looking to do. It's great. I'm not clear on what you want. Do you want to see this relationship when editing a student or are you trying to display the relationship on the front end? – rudtek Nov 18 '16 at 22:12
-1

Maybe you're using the wrong tool to represent relations between posts. the custom post meta fields api is somehow inefficient for that task and has certain restrictions.

I advice to have a look at the "posts to posts" plugin from pipin which is much more suited for that task.

Not the answer you're looking for? Browse other questions tagged or ask your own question.