wp_nav_menu_container_allowedtags
Filters the list of HTML tags that are valid for use as menu containers.
Usage
add_filter( 'wp_nav_menu_container_allowedtags', 'wp_kama_nav_menu_container_allowedtags_filter' ); /** * Function for `wp_nav_menu_container_allowedtags` filter-hook. * * @param string[] $tags The acceptable HTML tags for use as menu containers. * * @return string[] */ function wp_kama_nav_menu_container_allowedtags_filter( $tags ){ // filter... return $tags; }
- $tags(string[])
- The acceptable HTML tags for use as menu containers.
Default: array containing 'div' and 'nav'
Changelog
Since 3.0.0 | Introduced. |
Where the hook is called
wp_nav_menu_container_allowedtags
wp-includes/nav-menu-template.php 184
$allowed_tags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'nav' ) );