<?php
wp_nav_menu( [
'theme_location' => 'aside-1',
'menu' => '',
'container' => '',
'container_class' => '',
'container_id' => '',
'menu_class' => 'aside-menu__inner',
'menu_id' => '',
'echo' => true,
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'items_wrap' => '<ul id="%1$s" class="%2$s dflex">%3$s</ul>',
'depth' => 1,
] );
?>
<?php if( get_field('name_direction_2') ): ?>
в аргумент menu. Т.е. чтобы было примерно так (но это не работает):<?php
wp_nav_menu( [
'theme_location' => 'aside-1',
'menu' => '<?php if( get_field('name_direction_2') ): ?>',
'container' => '',
'container_class' => '',
'container_id' => '',
'menu_class' => 'aside-menu__inner',
'menu_id' => '',
'echo' => true,
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'items_wrap' => '<ul id="%1$s" class="%2$s dflex">%3$s</ul>',
'depth' => 1,
] );
?>
$args = [
'theme_location' => 'aside-1',
'menu' => '',
'container' => '',
'container_class' => '',
'container_id' => '',
'menu_class' => 'aside-menu__inner',
'menu_id' => '',
'echo' => true,
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'items_wrap' => '<ul id="%1$s" class="%2$s dflex">%3$s</ul>',
'depth' => 1,
];
if ( get_field('name_direction_2') ) {
$args['menu'] = get_field('name_direction_2');
}
wp_nav_menu( $args );