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

YouTube and Vimeo Gutenberg blocks don't apply additional CSS Classes #1966

Open
terencehoverter opened this issue Sep 23, 2019 · 3 comments
Labels
Backend (Server) Related to the server-side (includes PHP, HTML, etc). 🪲 Bug Something isn't working. WP Admin / Shortcode / Widget Related to the WordPress admin-side (like the Dashboard), or shortcodes/widgets.
Milestone

Comments

@terencehoverter
Copy link
Contributor

YouTube and Vimeo Gutenberg blocks don't apply additional CSS Classes
For each block in the Gutenberg editor, under the "Advanced" section of the block editor, you have the option to add additional CSS classes to the block. When adding classes to the Nebula Video blocks, the classes are not applied to the outputted HTML

Steps to Reproduce

  1. Go to an page with Gutenburg editor
  2. Add a Nebula Vimeo/YouTube block and add a valid video id
  3. Expand the "Advanced" tab
  4. Add a class to the "Additional CSS Class" field
  5. Update & preview output

Expected Behavior
The additional class should be added to the block's tag or its wrapper

Environment Details
Dell PC, Windows 10, Chrome Version 77.0.3865.90

@terencehoverter terencehoverter added the 🪲 Bug Something isn't working. label Sep 23, 2019
@chrisblakley chrisblakley added Backend (Server) Related to the server-side (includes PHP, HTML, etc). WP Admin / Shortcode / Widget Related to the WordPress admin-side (like the Dashboard), or shortcodes/widgets. labels Sep 23, 2019
@chrisblakley chrisblakley added this to the 8.0 Eight-Burst milestone Sep 23, 2019
@chrisblakley
Copy link
Owner

chrisblakley commented Sep 23, 2019

I'm also noticing that after I save a post, the "Additional CSS Class(es)" field will be empty. I do see that it's working prior to saving (all in JS) by console logging the className variable, but I can't get it to output on the front end and as soon as I press the "Update" button to save, the input clears out...

Very similar to what is described here: WordPress/gutenberg#9991
But that appears to be resolved by WordPress Core a year ago...

Page I'm testing on: https://gearside.com/nebula/test-of-gutenberg-blocks/

@chrisblakley
Copy link
Owner

I confirmed that the admin editor (JS) is outputting the Additional CSS Classes field onto the appropriate element.

Comparing to this: CalderaWP/Caldera-Forms@dcd3e5f
I can assume that my PHP code is written correctly as well ($attributes['className']) should work.

So... the core of this problem is that the Additional CSS Class(es) field is emptying when saving posts... Not sure why it is doing that for this block and not for others...

@chrisblakley
Copy link
Owner

Just checked this again after the WP core 5.4 update and it's still a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend (Server) Related to the server-side (includes PHP, HTML, etc). 🪲 Bug Something isn't working. WP Admin / Shortcode / Widget Related to the WordPress admin-side (like the Dashboard), or shortcodes/widgets.
Projects
None yet
Development

No branches or pull requests

2 participants