Home › Forums › ACF PRO › Menu Item Depth › Reply To: Menu Item Depth
I got halfway there. With the help of this thread and some other research, I managed to find that the $options
parameters of the rule_match callback has the following data:
array(5) {
["lang"]=> string(0) ""
["ajax"]=> bool(false)
["nav_menu_item"]=> string(9) "post_type"
["nav_menu_item_id"]=> string(3) "395"
["nav_menu_item_depth"]=> int(1)
}
Using the nav_menu_item_depth
I was able to show the field only on the related depth.
Unfortunately this does not update when drag and dropping menu elements around. Adding that functionality would require dabbing in the related JavaScript and I’m not even sure that’s possible.
Edit: code formatting and punctuation.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.