-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Implement the custom classname support hook in the server #24483
Conversation
77141d7
to
7e93d38
Compare
Size Change: +3.33 kB (0%) Total Size: 1.16 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this out on 'Site Title' block and can verify the custom class name is now applied correctly on the front-end! 🎉
This looks good to me, as it follows the standard convention for the rest of the supported styles (minus the slight change to default true
since it is an opt-out setting?)
I assume we should probably expand the test file to include this as well? Generally for each style I have added 1 test to ensure the style is added when expected, 1 test to ensure the style isnt added when unsupported, and generally update the all-applied test to include it as well. With a lot of styles being supported this convention is growing the file quite a bit, so maybe you have other ideas? Although, it is simple enough to create new ones with copy/paste and minimal alteration as the format is very similar for them all. 🤷♀️
Thanks for testing @Addison-Stavlo I've added a unit test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, it looks good to me!
I also went through and tested the noted blocks:
archives, calendar, tag-cloud, categories, latest comments, latest posts, navigation, rss, and search.
And all are having custom classnames applied as expected. 🎉
In different dynamic blocks, we support custom class names in the server in an Adhoc way and now that we have the block-supports handling on the server as well, this PR implements it automatically for all these blocks.
There are still other hooks that could benefit from a similar approach: anchor, generated classname.
Testing instructions
Check that custom classnames work for these blocks (editor and frontend)