function block_core_navigation_add_directives_to_submenu( $w,
$block_attributes ) { while ( $w->
next_tag( array
( 'tag_name' => 'LI',
'class_name' => 'has-child',
) ) ) { // Add directives to the parent `<li>`.
$w->
set_attribute( 'data-wp-interactive', true
);
$w->
set_attribute( 'data-wp-context', '{ "core": { "navigation": { "isMenuOpen": { "click": false, "hover": false }, "overlay": false } } }'
);
$w->
set_attribute( 'data-wp-effect', 'effects.core.navigation.initMenu'
);
$w->
set_attribute( 'data-wp-on--focusout', 'actions.core.navigation.handleMenuFocusout'
);
$w->
set_attribute( 'data-wp-on--keydown', 'actions.core.navigation.handleMenuKeydown'
);
if ( !
isset( $block_attributes['openSubmenusOnClick'
] ) || false ===
$block_attributes['openSubmenusOnClick'
] ) { $w->
set_attribute( 'data-wp-on--mouseenter', 'actions.core.navigation.openMenuOnHover'
);
$w->
set_attribute( 'data-wp-on--mouseleave', 'actions.core.navigation.closeMenuOnHover'
);
} // Add directives to the toggle submenu button.
if ( $w->
next_tag(