Field Render

Display a Menu Locations selector as radio, checkbox or select field type.

Field Group

Field Settings

Setting nameDescription
Allow FormsFilter which menu locations can be chosen
AppearanceSelect the appearance of this field
Default ValueEnter each default value on a new line
Return ValueReturn the name, local or both (array)
Allow NullAllow empty value
LayoutChoose the layout
ToggleAllow to toggle all values
Allow Custom
Allow custom value
Save Custom
Save custom value in the field settings
Select multiple valuesAllow multiple values selection
Stylised UIEnable Select2 UI style

Field Value

Return Format: Array

$menu_locations = get_field('menu_locations');

/**
 * array(
 *     'name'  => 'primary',
 *     'label' => 'Primary Menu',
 * )
 */

Return Format: Name

$menu_locations = get_field('menu_locations');

// primary

Return Format: Label

$menu_locations = get_field('menu_locations');

// Primary Menu

Unformatted Value

$menu_locations = get_field('menu_locations', false, false);

// primary