wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



sanitize_locale_name › WordPress Function

Seit6.2.1
Veraltetn/v
sanitize_locale_name ( $locale_name )
Parameter:
  • (string) $locale_name The locale name to be sanitized.
    Erforderlich: Ja
Gibt zurück:
  • (string) The sanitized value.
Definiert in:
Codex:

Strips out all characters not allowed in a locale name.



Quellcode

function sanitize_locale_name( $locale_name ) {
	// Limit to A-Z, a-z, 0-9, '_', '-'.
	$sanitized = preg_replace( '/[^A-Za-z0-9_-]/', '', $locale_name );

	/**
	 * 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.
	 */
	return apply_filters( 'sanitize_locale_name', $sanitized, $locale_name );
}