Home › Forums › Backend Issues (wp-admin) › Assigning Custom Fields To Child/Parents? › Reply To: Assigning Custom Fields To Child/Parents?
I imagine that you’ll need to do several things. The first three functions that set up the rules when creating a field group in ACF should be pretty straight forward. Actually I don’t think you need to use acf_location_rules_operator() because I would use the standard == != and use “Top Level Post” or “Child Post” for the choices.
Your custom rules also do not need to make the post_type selection. When creating your group you’d just use two rules
That leaves the function for testing the parent/child rule. Take a look at this for information on testing to see if a page is a child page: http://codex.wordpress.org/Conditional_Tags#A_PAGE_Page
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.