Make WordPress Core

Changeset 51881 for trunk


Ignore:
Timestamp:
10/02/2021 05:04:52 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Twenty Twenty-One: Keep the closing </span> tag in footer links.

When the link_after value is emptied to reset any description markup, make sure not to remove the closing tag within footer links.

Follow-up to [49216].

Props sabernhardt, mukesh27.
Fixes #54209.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwentyone/inc/menu-functions.php

    r51304 r51881  
    8888 */
    8989function twenty_twenty_one_add_menu_description_args( $args, $item, $depth ) {
    90     $args->link_after = '';
     90    if ( '</span>' !== $args->link_after ) {
     91        $args->link_after = '';
     92    }
     93
    9194    if ( 0 === $depth && isset( $item->description ) && $item->description ) {
    9295        // The extra <span> element is here for styling purposes: Allows the description to not be underlined on hover.
    9396        $args->link_after = '<p class="menu-item-description"><span>' . $item->description . '</span></p>';
    9497    }
     98
    9599    return $args;
    96100}
Note: See TracChangeset for help on using the changeset viewer.