Current status: Unsolved. . Done
Custom Fields for Menu Items
  • It would be awesome if custom fields could be added to menu items. Then, it would be possible to write a custom walker to do something like add thumbnails for your menu items, for example.

    In case anyone finds this post looking for said capability, here is my workaround:

    For menu items pointing to a page or post, you can get the target post's ID in your custom menu walker's start_el() function with
    $item->object_id

    (Remember that $item is one of the arguments passed to start_el(), and it represents the menu item object). From there, you can use the ACF API to access any custom field for that post:
    $menu_thumb = get_field('menu_thumbnail', $item->object_id);


    Adding support for categories or tags is only slightly more complicated. You just need a conditional statement checking $item->object to see which type it is ('custom', 'post', 'page', 'category', 'tag'), so you can use the proper ACF API method to grab the custom field: http://www.advancedcustomfields.com/docs/tutorials/retrieving-values-from-other-pages-taxonomy-user-media/

    Things start to get messy with custom menu items. One option would be to use custom fields from site-wide options: http://www.advancedcustomfields.com/docs/tutorials/retrieving-values-from-the-options-page/

    Another option would be to use the Relationship (XFN) field in the menu item (accessible by $item->xfn) to indicate a relationship with another page/post ID. You could create a 'dummy' post where you store your custom fields for that menu item.

    Thanks for the fantastic plugin!