WordPress filter hook · part of WordPress core

navigation_widgets_format

A WordPress core filter that 8 plugins also fire themselves, running on 914K+ sites between them.

“This filter is documented in wp-includes/widgets/class-wp-nav-menu-widget.php”

How to use navigation_widgets_format

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'navigation_widgets_format', function( $format ) {
	// Change $format here.
	return $format;
}, 10, 1 );

Argument names come from Polylang's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

8 plugins that fire navigation_widgets_format

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Polylang icon Polylang900,000+ installs apply_filters( 'navigation_widgets_format', $format ) src/Switcher/Layout/Abstract_Layout.php:153
  2. Privacy Policy Generator, Terms & Conditions, GDPR, CCPA, Cookie Policy & Disclaimer Templates icon Privacy Policy Generator, Terms & Conditions, GDPR, CCPA, Cookie Policy & Disclaimer Templates10,000+ installs apply_filters( 'navigation_widgets_format', $format ) widgets/class-wp-widget-legal-pages.php:107
  3. Linguator icon Linguator3,000+ installs apply_filters( 'navigation_widgets_format', $format ) includes/switcher/layout/abstract-layout.php:141
  4. Recent Posts Widget Advanced icon Recent Posts Widget Advanced300+ installs apply_filters( 'navigation_widgets_format', $kgmarp_format ) templates/frontend-1.php:27
  5. Administrator Z icon Administrator Z200+ installs apply_filters( 'navigation_widgets_format', $format ) src/Widget/Adminz_RecentPosts.php:53
  6. Multilingual AI Translator icon Multilingual AI Translator30+ installs apply_filters( 'navigation_widgets_format', $format ) includes/widgets/widget-languages.php:117
  7. Archives Widget Extended icon Archives Widget ExtendedFewer than 10 installs apply_filters( 'navigation_widgets_format', $format ) Widgets/class-aexws-widget.php:205
  8. Lenxel AI LMS icon Lenxel AI LMSFewer than 10 installs apply_filters( 'navigation_widgets_format', $format ) widgets/recent_posts.php:120

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.