wp_nav_menu_container_allowedtags

wp_nav_menu_container_allowedtags

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.8

apply_filters('wp_nav_menu_container_allowedtags') is found 1 times:

  • /wp-includes/nav-menu-template.php line 189
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    *
     * @param string[] $tags The acceptable HTML tags for use as menu containers.
     *                       Default is array containing 'div' and 'nav'.
     */
    $allowed_tags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'nav' ) );
     
    if ( is_string( $args->container ) && in_array( $args->container, $allowed_tags, true ) ) {
        $show_container = true;
        $class          = $args->container_class ? ' class="' . esc_attr( $args->container_class ) . '"' : ' class="menu-' . $menu->slug . '-container"';
        $id             = $args->container_id ? ' id="' . esc_attr( $args->container_id ) . '"' : '';
        $aria_label     = ( 'nav' === $args->container && $args->container_aria_label ) ? ' aria-label="' . esc_attr( $args->container_aria_label ) . '"' : '';