wppaste
WordPress

apply_filters( 'navigation_widgets_format', string $format )

Since
5.5.0
Filters the HTML format of widgets with navigation links.

Compatibility

WordPress
since 5.5.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$formatstring
The type of markup to use in widgets with navigation links.
Accepts 'html5', 'xhtml'.

Where this hook fires · 9

  • wp-includes/widgets/class-wp-nav-menu-widget.php:72WP_Nav_Menu_Widget::widget()
  • wp-includes/widgets/class-wp-widget-archives.php:128WP_Widget_Archives::widget()
  • wp-includes/widgets/class-wp-widget-categories.php:116WP_Widget_Categories::widget()
  • wp-includes/widgets/class-wp-widget-meta.php:61WP_Widget_Meta::widget()
  • wp-includes/widgets/class-wp-widget-pages.php:98WP_Widget_Pages::widget()
  • wp-includes/widgets/class-wp-widget-recent-comments.php:131WP_Widget_Recent_Comments::widget()
  • wp-includes/widgets/class-wp-widget-recent-posts.php:100WP_Widget_Recent_Posts::widget()
  • wp-includes/widgets/class-wp-widget-rss.php:124WP_Widget_RSS::widget()
  • wp-includes/widgets/class-wp-widget-tag-cloud.php:99WP_Widget_Tag_Cloud::widget()

Source code

		 *		 * @since 5.5.0		 *		 * @param string $format The type of markup to use in widgets with navigation links.		 *                       Accepts 'html5', 'xhtml'.		 */		$format = apply_filters( 'navigation_widgets_format', $format ); 		if ( 'html5' === $format ) {			// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.			$title      = trim( strip_tags( $title ) );			$aria_label = $title ? $title : $default_title;

Changelog

Introduced in 5.5.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.