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

Fix group block editor block class name #20164

Merged
merged 1 commit into from
Feb 12, 2020

Conversation

talldan
Copy link
Contributor

@talldan talldan commented Feb 11, 2020

Description

Fixes #20140.

#19181 seems to have accidentally removed the use of the className prop in the group block's edit function. This was causing custom block styles and the Additional CSS Classes option not to function in the editor. This PR restores use of the className prop.

How has this been tested?

  1. Add a class name (e.g. 'my-class') to a group block using the Advanced > Additional CSS Class(es) option
  2. Inspect the group block using dev tools. The block should have the classname matching the one added above (e.g. 'wp-block-group my-class')

  1. Register a block style by adding something like the following
register_block_style( 'core/group', [ 'name' => 'golden-border', 'label' => 'Golden Border', 'style_handle' => 'block-styles-stylesheet', ] );
  1. Reload the editor and toggle the style on a group block
  2. Inspect the group block using the dev tools. The block should have the class name 'wp-block-group is-style-golden-border'.

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • 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.

@talldan talldan added [Type] Regression Related to a regression in the latest release [Block] Group Affects the Group Block labels Feb 11, 2020
@talldan talldan self-assigned this Feb 11, 2020
@talldan talldan merged commit 17aeda9 into master Feb 12, 2020
@talldan talldan deleted the fix/group-block-custom-class-names-and-styles branch February 12, 2020 13:24
@github-actions github-actions bot added this to the Gutenberg 7.6 milestone Feb 12, 2020
@jorgefilipecosta jorgefilipecosta added the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Feb 14, 2020
@jorgefilipecosta jorgefilipecosta removed the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Group Affects the Group Block [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom styles of core/group invisible in editor
3 participants