Support

Account

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

    • Post Type == your custom post type
    • Post Level == top level or child

    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