WordPress.org

Make WordPress Core

Opened 3 months ago

Last modified 3 months ago

#43703 new defect (bug)

Edit Category screen - Error shown in green and admin notice not dismissible.

Reported by: birgire Owned by:
Milestone: 5.0 Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: has-patch has-screenshots
Focuses: administration Cc:

Description

When we edit a category, on the Edit Category screen, then there are two things that need adjustments:

  1. The "Category updated." admin notice is currently not dismissible.
  2. The "Category not updated." admin notice is currently shown in green (not red).

To replicate part 2, one can e.g. disable JS and update the term without a name.

Example location:

/wp-admin/term.php?taxonomy=category&tag_ID=123

The corresponding part that displays the message for categories, tags and other terms:

https://core.trac.wordpress.org/browser/tags/4.9.5/src/wp-admin/edit-tag-form.php#L73-L82

Attachments (4)

dismissible.jpg (18.6 KB) - added by birgire 3 months ago.
Dismissible admin notice
error-green.jpg (12.5 KB) - added by birgire 3 months ago.
The update error is currently shown in green.
error-red.jpg (12.6 KB) - added by birgire 3 months ago.
Here's the error shown in red, as expected
43703.diff (1.3 KB) - added by birgire 3 months ago.

Download all attachments as: .zip

Change History (6)

@birgire
3 months ago

Dismissible admin notice

@birgire
3 months ago

The update error is currently shown in green.

@birgire
3 months ago

Here's the error shown in red, as expected

@birgire
3 months ago

#1 @birgire
3 months ago

43703.diff is a suggested patch that:

  • let's the admin notice have the error class (displayed as red) if the $msg index is 5 (for not updated), else the updated class (displayed as green).
  • adds the notice is-dismissible classes to the admin notice.
  • escapes the message output.
Last edited 3 months ago by birgire (previous) (diff)

#2 @SergeyBiryukov
3 months ago

  • Milestone changed from Awaiting Review to 5.0
Note: See TracTickets for help on using tickets.