Revert "Add support for menu description. (#1771)" (#1944)

This reverts commit 26583788de.
This commit is contained in:
Luigi Teschio 2022-04-04 14:14:14 +02:00 committed by GitHub
parent 07b1c71a8e
commit 64f5950d83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 1 additions and 35 deletions

View file

@ -552,8 +552,6 @@
transition: none;
> li {
vertical-align: top;
// The first level menu item
> a {
padding: ms(3) 1em;
@ -571,12 +569,6 @@
}
}
.menu-item-description {
font-size: ms(-1);
opacity: 0.67;
margin: 0;
}
ul {
// Dropdowns
margin-left: 0;

View file

@ -2182,7 +2182,7 @@ dl.variation {
.count {
font-weight: 400;
opacity: 0.67;
opacity: 0.5;
font-size: ms(-1);
}

View file

@ -29,7 +29,6 @@ $storefront = (object) array(
);
require 'inc/storefront-functions.php';
require 'inc/storefront-menu-functions.php';
require 'inc/storefront-template-hooks.php';
require 'inc/storefront-template-functions.php';
require 'inc/wordpress-shims.php';

View file

@ -1,25 +0,0 @@
<?php
/**
* Storefront menu functions.
*
* @package storefront
*/
/**
* Filters the arguments for a single nav menu item.
*
* @param stdClass $args An object of wp_nav_menu() arguments.
* @param WP_Post $item Menu item data object.
* @param int $depth Depth of menu item. Used for padding.
*
* @return stdClass
*/
function storefront_add_menu_description_args( $args, $item, $depth ) {
$args->link_after = '';
if ( 0 === $depth && isset( $item->description ) && $item->description ) {
// The extra <span> element is here for styling purposes: Allows the description to not be underlined on hover.
$args->link_after = '<p class="menu-item-description"><span>' . $item->description . '</span></p>';
}
return $args;
}
add_filter( 'nav_menu_item_args', 'storefront_add_menu_description_args', 10, 3 );