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!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz— Advanced Custom Fields (@wp_acf) March 7, 2023
© 2023 Advanced Custom Fields.