Adds a WP menu selector custom field type to ACF. Will list all available WP menus and return the selected menu's slug.
- Copy the
acf-menu-select
folder into yourwp-content/plugins
folder - Activate the menu plugin via the plugins admin page
- Create a new field via ACF and select the 'Menu Selector' type under the 'Choice' category
- When using in the front end, be sure to get the menu object, the field will simply return the menu identifier string.
Front-end example:
Wordpress
wp_get_nav_menu_object(get_field('custom_menu'));
Timber (timber.php, page.php, etc..)
$context['custom_menu'] = new Timber\Menu(get_field('custom_menu'));