Display a Menu selector as radio, checkbox or select field type.
Setting name | Description |
Allow Forms | Filter which menus can be chosen |
Appearance | Select the appearance of this field |
Default Value | Enter each default value on a new line |
Return Value | Return the menu object, menu name or menu ID |
Allow Null | Allow empty value |
Layout | Choose the layout |
Toggle | Allow to toggle all values |
Allow Custom | Allow custom value |
Save Custom | Save custom value in the field settings |
Select multiple values | Allow multiple values selection |
Stylised UI | Enable Select2 UI style |
$menus = get_field('menus');
/**
* array(
* 'term_id' => 7,
* 'name' => 'Menu',
* 'slug' => 'menu',
* 'term_group' => 0,
* 'term_taxonomy_id' => 7,
* 'taxonomy' => 'nav_menu',
* 'description' => '',
* 'parent' => 0,
* 'count' => 1,
* 'filter' => 'raw',
* )
*/
$menus = get_field('menus');
// menu
$menus = get_field('menus');
// 7
$menus = get_field('menus', false, false);
// menu