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

The title of the Widget Group block becomes h2.widget-title. #38197

Closed
ddryo opened this issue Jan 25, 2022 · 4 comments
Closed

The title of the Widget Group block becomes h2.widget-title. #38197

ddryo opened this issue Jan 25, 2022 · 4 comments
Labels
[Block] Legacy Widget Affects the Legacy Widget Block - used for displaying Classic Widgets [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Type] Bug An existing feature does not function as intended

Comments

@ddryo
Copy link
Contributor

ddryo commented Jan 25, 2022

Description

Thank you for creating the widget group block.

However, I found one problem.

The title of the Widget Group block becomes h2.widget-title.

The class set in register_sidebar() is not used.

Step-by-step reproduction instructions

  1. For example, we can set the Widget Title to div.c-widget__title as follows
register_sidebar(
    array(
        'name'          => 'Sidebar',
        'id'            => 'sidebar-1',
        'before_widget' => '<div id="%1$s" class="c-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<div class="c-widget__title">',
        'after_title'   => '</div>',
    )
);
  1. Use Widget Group block.

Screenshots, screen recording, code snippet

スクリーンショット 2022-01-25 12 38 22

The div#block-7 at the top of this image is the HTML for using the Widget Group.

And below it, div#categories-2 is the HTML when using the Legacy Widget.

Environment info

  • WordPress 5.9 RC4

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@ddryo
Copy link
Contributor Author

ddryo commented Jan 25, 2022

Additionally, there is a similar problem with #33507

@ddryo
Copy link
Contributor Author

ddryo commented Jan 25, 2022

So, the Title of the Widget area is a situation where various DOMs can be mixed as shown below.

  • h2.widget-title (Title of the Widget Group block)
  • h2.widgettitle (Title of the Legacy Widget manually placed in the Group block)
  • div.c-widget__title (A class specified by the theme. Legacy widgets that have been installed in the past.)
  • Just an h2 tag. (A widget tile that is initially placed when we install WordPress 5.8 on our site.)

@annezazu annezazu added [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Type] Bug An existing feature does not function as intended labels Jan 26, 2022
@annezazu
Copy link
Contributor

@kevin940726 any insight here?

@annezazu annezazu added the [Block] Legacy Widget Affects the Legacy Widget Block - used for displaying Classic Widgets label Jan 26, 2022
@noisysocks
Copy link
Member

This should be fixed by https://core.trac.wordpress.org/changeset/52730. Please test the WP 5.9.1 RC when it is released to confirm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Legacy Widget Affects the Legacy Widget Block - used for displaying Classic Widgets [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants