WordPress filter hook · part of WordPress core

locale

A WordPress core filter that 14 plugins also fire themselves, running on 1,250+ sites between them.

“This filter is documented in wp-includes/l10n.php”

How to use locale

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( 'locale', function( $locale ) {
	// Change $locale here.
	return $locale;
}, 10, 1 );

Argument names come from Aitasi Coming Soon'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 →

14 plugins that fire locale

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

  1. Aitasi Coming Soon icon Aitasi Coming Soon900+ installs apply_filters( 'locale', $locale ) admin/codestar-framework/cs-framework-path.php:405
  2. eDS Responsive Menu icon eDS Responsive Menu200+ installs apply_filters( 'locale', $locale ) framework/eds-framework-path.php:405
  3. Easy Woocommerce Customizer icon Easy Woocommerce Customizer50+ installs apply_filters( 'locale', $locale ) options/cs-framework-path.php:405
  4. Post Slider icon Post Slider20+ installs apply_filters( 'locale', $locale ) cs-framework/cs-framework-path.php:405
  5. Nasim Persian Maker icon Nasim Persian Maker20+ installs apply_filters( 'locale', $locale ) cs-framework-path.php:395
  6. CC Manga Comic Reader icon CC Manga Comic Reader10+ installs apply_filters( 'locale', $locale ) lib/codestar-framework/cs-framework-path.php:405
  7. Awesome WordPress Slider icon Awesome WordPress Slider10+ installs apply_filters( 'locale', $locale ) inc/cs-framework/cs-framework-path.php:405
  8. Amazing Portfolio icon Amazing Portfolio10+ installs apply_filters( 'locale', $locale ) inc/framework/cs-framework-path.php:405
  9. Ultimate Carousel icon Ultimate Carousel10+ installs apply_filters( 'locale', $locale ) inc/framework/cs-framework-path.php:405
  10. WP TAB icon WP TAB10+ installs apply_filters( 'locale', $locale ) assets/admin/cs-framework-path.php:379
  11. EZFunnels icon EZFunnels10+ installs apply_filters( 'locale', $locale ) includes/services/locale.php:59
  12. SwiftLing icon SwiftLingFewer than 10 installs apply_filters( 'locale', $locale ) includes/translate.php:421
  13. Electro Pricing Tables Lite icon Electro Pricing Tables LiteFewer than 10 installs apply_filters( 'locale', $locale ) lib/codestar-framework-1.0.1/cs-framework-path.php:405
  14. RS Coming Soon icon RS Coming SoonFewer than 10 installs apply_filters( 'locale', $locale ) admin/cs-framework-path.php:405

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.