Changeset 52809 for trunk/src/wp-includes/formatting.php
- Timestamp:
- 02/28/2022 03:40:15 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r52789 r52809 1584 1584 * @since 4.8.0 Added locale support for `bs_BA`. 1585 1585 * @since 5.7.0 Added locale support for `de_AT`. 1586 * 1587 * @param string $string Text that might have accent characters 1586 * @since 6.0.0 Added the `$locale` parameter. 1587 * 1588 * @param string $string Text that might have accent characters. 1589 * @param string $locale Optional. The locale to use for accent removal. Some character 1590 * replacements depend on the locale being used (e.g. 'de_DE'). 1591 * Defaults to the current locale. 1588 1592 * @return string Filtered string with replaced "nice" characters. 1589 1593 */ 1590 function remove_accents( $string ) {1594 function remove_accents( $string, $locale = '' ) { 1591 1595 if ( ! preg_match( '/[\x80-\xff]/', $string ) ) { 1592 1596 return $string; … … 1924 1928 1925 1929 // Used for locale-specific rules. 1926 $locale = get_locale(); 1927 1928 if ( in_array( $locale, array( 'de_DE', 'de_DE_formal', 'de_CH', 'de_CH_informal', 'de_AT' ), true ) ) { 1930 if ( empty( $locale ) ) { 1931 $locale = get_locale(); 1932 } 1933 1934 /* 1935 * German has various locales (de_DE, de_CH, de_AT, ...) with formal and informal variants. 1936 * There is no 3-letter locale like 'def', so checking for 'de' instead of 'de_' is safe, 1937 * since 'de' itself would be a valid locale too). 1938 */ 1939 if ( str_starts_with( $locale, 'de' ) ) { 1929 1940 $chars['Ä'] = 'Ae'; 1930 1941 $chars['ä'] = 'ae';
Note: See TracChangeset
for help on using the changeset viewer.