Skip to content

Commit

Permalink
Merge pull request #4259 from Codeinwp/fix/4256
Browse files Browse the repository at this point in the history
Fixed duplicate id issue with secondary nav menu
  • Loading branch information
vytisbulkevicius authored Jul 11, 2024
2 parents aff526c + 5e821df commit 519535f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion header-footer-grid/Core/Components/SecondNav.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public function add_settings() {
*/
public function render_component() {
do_action( 'neve_before_render_nav', $this->get_id() );
Main::get_instance()->load( 'components/component-nav-secondary' );
Main::get_instance()->load( 'components/component-nav-secondary', '', $this->args );
do_action( 'neve_after_render_nav', $this->get_id() );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@
namespace HFG;

use HFG\Core\Components\SecondNav;
use HFG\Core\Builder\Header as HeaderBuilder;

$style = component_setting( SecondNav::STYLE_ID );

$style = component_setting( SecondNav::STYLE_ID );
$device_class = isset( $args ) && ! empty( $args ) ? $args['device'] : '';
$container_classes = [ 'nav-menu-secondary' ];

if ( $style !== 'style-plain' ) {
$container_classes[] = $style;
$container_classes[] = 'm-style';
}

$menu_id = SecondNav::COMPONENT_ID . '-' . $device_class . '-' . current_row( HeaderBuilder::BUILDER_NAME );
?>
<div class="nv-top-bar">
<div role="navigation" class="menu-content <?php echo esc_attr( join( ' ', $container_classes ) ); ?>"
Expand All @@ -28,7 +30,7 @@
array(
'theme_location' => 'top-bar',
'menu_class' => 'nav-ul',
'menu_id' => 'secondary-menu',
'menu_id' => $menu_id,
'container' => 'ul',
'depth' => - 1,
'fallback_cb' => '__return_false',
Expand Down

0 comments on commit 519535f

Please sign in to comment.