Editor: Use wp_unique_id() instead of uniqid() to generate CSS class names.

Backports changes from https://github.com/WordPress/gutenberg/pull/38891.
See https://github.com/WordPress/gutenberg/issues/38889.

Props westonruter, mamaduka.
See #55474.


git-svn-id: https://develop.svn.wordpress.org/trunk@53012 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jb Audras
2022-03-29 13:04:24 +00:00
parent e19b7ead2c
commit 1cb0e9ced6
4 changed files with 7 additions and 7 deletions
@@ -11,7 +11,7 @@ class Tests_Block_Supports_Elements extends WP_UnitTestCase {
* @return string String where the unique id classes were replaced with "wp-elements-1".
*/
private static function make_unique_id_one( $string ) {
return preg_replace( '/wp-elements-.{13}/', 'wp-elements-1', $string );
return preg_replace( '/wp-elements-\d+/', 'wp-elements-1', $string );
}
/**