Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use wp_unique_id() instead of uniqid() to generate CSS class names #38891

Merged
merged 2 commits into from
Feb 21, 2022

Conversation

westonruter
Copy link
Member

Fixes #38889.

Description

Testing Instructions

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).
  • I've updated related schemas if appropriate.

@gziolo gziolo added [Type] Performance Related to performance efforts CSS Styling Related to editor and front end styles, CSS-specific issues. labels Feb 17, 2022
Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good 👍

On the client-side, we're using useInstanceId to generate unique class names, which works in similar manner as wp_unique_id

@Mamaduka Mamaduka merged commit e42655c into trunk Feb 21, 2022
@Mamaduka Mamaduka deleted the update/uniqid branch February 21, 2022 15:32
@github-actions github-actions bot added this to the Gutenberg 12.7 milestone Feb 21, 2022
@westonruter
Copy link
Member Author

Should this get ported into core trunk for the next maintenance release (i.e. 5.9.2)?

@Mamaduka Mamaduka added the Backport to WP Minor Release Pull request that needs to be backported to a WordPress minor release label Feb 25, 2022
@Mamaduka
Copy link
Member

Added label for backporting.

@Mamaduka Mamaduka removed the Backport to WP Minor Release Pull request that needs to be backported to a WordPress minor release label Mar 29, 2022
Mamaduka pushed a commit that referenced this pull request Mar 29, 2022
#38891)

* Use wp_unique_id() instead of uniqid() to generate CSS class names

* Fix elements test by upadting pattern in make_unique_id_one
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Mar 29, 2022
…ass names.

Backports changes from WordPress/gutenberg#38891.
See WordPress/gutenberg#38889.

Props westonruter, mamaduka.
See #55474.

Built from https://develop.svn.wordpress.org/trunk@53012


git-svn-id: http://core.svn.wordpress.org/trunk@52601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Mar 29, 2022
…ass names.

Backports changes from WordPress/gutenberg#38891.
See WordPress/gutenberg#38889.

Props westonruter, mamaduka.
Merges [53012] to the 5.9 branch.
See #55474.


git-svn-id: https://develop.svn.wordpress.org/branches/5.9@53013 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Mar 29, 2022
…ass names.

Backports changes from WordPress/gutenberg#38891.
See WordPress/gutenberg#38889.

Props westonruter, mamaduka.
Merges [53012] to the 5.9 branch.
See #55474.

Built from https://develop.svn.wordpress.org/branches/5.9@53013


git-svn-id: http://core.svn.wordpress.org/branches/5.9@52602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
gMagicScott pushed a commit to gMagicScott/core.wordpress-mirror that referenced this pull request Mar 29, 2022
…ass names.

Backports changes from WordPress/gutenberg#38891.
See WordPress/gutenberg#38889.

Props westonruter, mamaduka.
See #55474.

Built from https://develop.svn.wordpress.org/trunk@53012


git-svn-id: https://core.svn.wordpress.org/trunk@52601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
gMagicScott pushed a commit to gMagicScott/core.wordpress-mirror that referenced this pull request Mar 29, 2022
…ass names.

Backports changes from WordPress/gutenberg#38891.
See WordPress/gutenberg#38889.

Props westonruter, mamaduka.
Merges [53012] to the 5.9 branch.
See #55474.

Built from https://develop.svn.wordpress.org/branches/5.9@53013


git-svn-id: https://core.svn.wordpress.org/branches/5.9@52602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
whereiscodedude pushed a commit to whereiscodedude/wpss that referenced this pull request Sep 18, 2022
…ass names.

Backports changes from WordPress/gutenberg#38891.
See WordPress/gutenberg#38889.

Props westonruter, mamaduka.
Merges [53012] to the 5.9 branch.
See #55474.

Built from https://develop.svn.wordpress.org/branches/5.9@53013
VenusPR added a commit to VenusPR/Wordpress_Richard that referenced this pull request Mar 9, 2023
…ass names.

Backports changes from WordPress/gutenberg#38891.
See WordPress/gutenberg#38889.

Props westonruter, mamaduka.
Merges [53012] to the 5.9 branch.
See #55474.

Built from https://develop.svn.wordpress.org/branches/5.9@53013


git-svn-id: http://core.svn.wordpress.org/branches/5.9@52602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Type] Performance Related to performance efforts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use of uniqid() in generated CSS class names breaks ability to cache parsed CSS
3 participants