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.