Leo
(@leohsiang)
Hi there,
Those are default classes in GP so sounds like something changed in WP 5.3.
Can you link me to the page in question?
It is in the backend, so I can only give you some steps to replicate. Just set h1 in typography to uppercase and then use this code and see it does not work. Even tried on a test site.
add_action( 'enqueue_block_editor_assets', function() {
$css = '.editor-post-title__block .editor-post-title__input {text-transform: none;}';
}, 100 );
Leo
(@leohsiang)
Sorry are you trying to add CSS as a snippet?
Does that code work for a twenty series WP theme?
Yes as a snippet. I tried 2020 theme and it seemed to work, though I am not sure if it is the code above or 2020 theme’s own style editor.
Theme Author
Tom
(@edge22)
Hi there,
That function won’t work as is.
Try this instead:
add_action( 'enqueue_block_editor_assets', function() {
$css = '.editor-post-title__block .editor-post-title__input {text-transform: none;}';
wp_add_inline_style( 'generate-block-editor-styles', $css );
}, 100 );
That code does not work either, Tom. It seems there have been some changes in WordPress 5.3.
Theme Author
Tom
(@edge22)
Can you try this?:
add_action( 'enqueue_block_editor_assets', function() {
$css = '.editor-post-title__block .editor-post-title__input {text-transform: none;}';
wp_add_inline_style( 'generate-block-editor-styles', $css );
}, 999 );
Let me know 🙂
I found where the problem is. That code does not like being mixed with other $css codes after it (in WP 5.3). It works only as a standalone. Had to create a new snippet for the other codes.
Yes. But I also had to adjust the priority for the other bunch (e.g. if I put 100 or 999 for both, the ones in the post body did not work). So I put like 999 for the title and 100 for the others.
Theme Author
Tom
(@edge22)
Glad you got it working 🙂