Index: wp-includes/taxonomy.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-includes/taxonomy.php	(revision b0f64a91b3da84f76d10ca3cac9a962f6dae74df)
+++ wp-includes/taxonomy.php	(revision )
@@ -2700,6 +2700,20 @@
 		$needs_suffix = false;
 	}
 
+	/**
+	 * Filters pre term slug.
+	 *
+	 * @since 4.6.0
+	 *
+	 * @param string|bool $pre Unique slug for the post, based on $post_name (with a -1, -2, etc. suffix)
+	 * @param string $slug Unique term slug.
+	 * @param WP_Term $term Term object.
+	 */
+	$pre = apply_filters( 'pre_unique_term_slug', false, $slug, $term );
+	if ( false !== $pre ) {
+		return $pre;
+	}
+
 	/*
 	 * If the taxonomy supports hierarchy and the term has a parent, make the slug unique
 	 * by incorporating parent slugs.
Index: wp-includes/post.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-includes/post.php	(revision b0f64a91b3da84f76d10ca3cac9a962f6dae74df)
+++ wp-includes/post.php	(revision )
@@ -3696,6 +3696,23 @@
 	if ( in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) || ( 'inherit' == $post_status && 'revision' == $post_type ) )
 		return $slug;
 
+	/**
+	 * Filters pre post slug.
+	 *
+	 * @since 4.6.0
+	 *
+	 * @param string|bool $pre Unique slug for the post, based on $post_name (with a -1, -2, etc. suffix)
+	 * @param string $slug The desired slug (post_name).
+	 * @param int $post_ID Post ID.
+	 * @param string $post_status No uniqueness checks are made if the post is still draft or pending.
+	 * @param string $post_type Post type.
+	 * @param int $post_parent Post parent ID.
+	 */
+	$pre = apply_filters( 'pre_unique_post_slug', false, $slug, $post_ID, $post_status, $post_type, $post_parent );
+	if ( false !== $pre ) {
+		return $pre;
+	}
+
 	global $wpdb, $wp_rewrite;
 
 	$original_slug = $slug;
