block_core_navigation_add_directives_to_submenu example

            if ( $w->next_tag(
                array(
                    'tag_name'   => 'BUTTON',
                    'class_name' => 'wp-block-navigation-submenu__toggle',
                )
            ) ) {
                $w->set_attribute( 'data-wp-on--click', 'actions.core.navigation.toggleMenuOnClick' );
                $w->set_attribute( 'data-wp-bind--aria-expanded', 'selectors.core.navigation.isMenuOpen' );
            };

            // Iterate through subitems if exist.             block_core_navigation_add_directives_to_submenu( $w$block_attributes );
        }
        return $w->get_updated_html();
    };

    /** * Replaces view script for the Navigation block with version using Interactivity API. * * @param array $metadata Block metadata as read in via block.json. * * @return array Filtered block type metadata. */
    
Home | Imprint | This part of the site doesn't use cookies.