Filter hook 'sanitize_locale_name'

in WP Core File wp-includes/formatting.php at line 2469

View Source

sanitize_locale_name

Filter Hook
Description
Filters a sanitized locale name string.

Hook Information

File Location wp-includes/formatting.php View on GitHub
Hook Type Filter
Line Number 2469

Hook Parameters

Type Name Description
string $sanitized The sanitized locale name.
string $locale_name The locale name before sanitization.

Usage Examples

Basic Usage
<?php
// Hook into sanitize_locale_name
add_filter('sanitize_locale_name', 'my_custom_filter', 10, 2);

function my_custom_filter($sanitized, $locale_name) {
    // Your custom filtering logic here
    return $sanitized;
}

Source Code Context

wp-includes/formatting.php:2469 - How this hook is used in WordPress core
<?php
2464  	 * @since 6.2.1
2465  	 *
2466  	 * @param string $sanitized   The sanitized locale name.
2467  	 * @param string $locale_name The locale name before sanitization.
2468  	 */
2469  	return apply_filters( 'sanitize_locale_name', $sanitized, $locale_name );
2470  }
2471  
2472  /**
2473   * Converts lone & characters into `&#038;` (a.k.a. `&amp;`)
2474   *

PHP Documentation

<?php
/**
	 * Filters a sanitized locale name string.
	 *
	 * @since 6.2.1
	 *
	 * @param string $sanitized   The sanitized locale name.
	 * @param string $locale_name The locale name before sanitization.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/formatting.php
Related Hooks

Related hooks will be displayed here in future updates.