Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #61396


Ignore:
Timestamp:
06/07/2024 07:33:00 AM (7 months ago)
Author:
oglekler
Comment:

pre_insert_term filter is only for the term itself and not filtering all $args and the plugin in question had only one opportunity to transliterate slug hooking sanitize_title(), which looks like a last resort instead of expected behavior, but this is not the source of the issue.

The source of trouble is strtolower(), which is only converting ASCII characters 🤦

	$name_match = null;
	if ( $name_matches ) {
		foreach ( $name_matches as $_match ) {
			if ( strtolower( $name ) === strtolower( $_match->name ) ) {
				$name_match = $_match;
				break;
			}
		}
	}

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #61396 – Description

    initial v1  
    11On the /wp-admin/edit-tags.php page, an attempt to add terms `Test` and `test` is leading to an error "A term with the name provided already exists in this taxonomy." and the term is not added, but if I am doing the same thing in Russian language with the usage of a plugin (CyrToLat in this case) that is making slug transliteration via the `pre_insert_term` filter, I am getting duplicate terms. I am not sure that this issue should be addressed to the plugin developer, because it looks like after filtering the term, we still need to ensure that this term is valid and comply with existing rules.
    22
     3
     4
     5
     6
    37@mihdan FYI