• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress a2z

WordPress a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / twentyfifteen_nav_description() – Display descriptions in main navigation.

You appear to be a bot. Output may be restricted

Description

Display descriptions in main navigation.

Usage

$string = twentyfifteen_nav_description( $item_output, $item, $depth, $args );

Parameters

$item_output
( string ) required – The menu item's starting HTML output.
$item
( WP_Post ) required – Menu item data object.
$depth
( int ) required – Depth of the menu. Used for padding.
$args
( stdClass ) required – An object of wp_nav_menu() arguments.

Returns

string Menu item with possible description.

Source

File name: twentyfifteen/functions.php
Lines:

1 to 7 of 7
function twentyfifteen_nav_description( $item_output, $item, $depth, $args ) {
  if ( 'primary' === $args->theme_location && $item->description ) {
    $item_output = str_replace( $args->link_after . '</a>', '<div class="menu-item-description">' . $item->description . '</div>' . $args->link_after . '</a>', $item_output );
  }

  return $item_output;
}
 

 View on Trac

Published: 19th December 2019 | Last updated: 21st August 2020

Primary Sidebar

Information

Function name: twentyfifteen_nav_description
Plugin ref: Twenty Fifteen
Version: 2.8
Sourcefile: functions.php
File ref: functions.php
Deprecated?: No
API Letters: D,N,T

Footer

WordPress a2z
WordPress a2z
WordPress Dynamic API Reference
WordPress 5.6. PHP: 7.3.26
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wp-a2z.org
© Copyright WordPress a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites