Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#45418 closed defect (bug) (reported-upstream)

Admin notices lose custom id and class attributes in Gutenberg editor

Reported by: ianmjones's profile ianmjones Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.0
Component: Editor Keywords:
Focuses: administration Cc:

Description

If a plugin creates a custom notice for display in the admin it usually includes an id and/or class attributes in the div that can be used to identify actions on it, such as dismiss.

In the Gutenberg editor admin notices are being displayed with new styling and class attributes different to when displayed in the rest of the WordPress admin dashboard and seem to have the id and custom class attributes stripped.

This makes it impossible for a plugin to identify its own notices and attach JavaScript handlers for the dismiss button and therefore properly register that the admin notice is no longer to be displayed.

Change History (2)

#1 @desrosj
6 years ago

  • Focuses administration added

I've opened GB-12320 for this because this needs to be solved in the Notices package of the new editor.

Last edited 6 years ago by desrosj (previous) (diff)

#2 @pento
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed

Thank you for the ticket @ianmjones, and for adding it the the Gutenberg repo, @ianmjones.

To avoid duplicating tracking, I'm going to close this ticket, so discussion can be focussed in GB12320.

Note: See TracTickets for help on using tickets.