WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 10 months ago

#36882 new enhancement

Add a reusable admin CSS class for destructive actions

Reported by: flixos90 Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Administration Keywords: needs-patch
Focuses: Cc:

Description

As generally recommended, plugin authors should not use regular buttons for destructive actions, like removing something.

However, while there are standardized classes for buttons in WordPress admin (button, button-primary, button-secondary), a similar standardized class is missing for the destructive link. There are several locations in the admin where such links are displayed, but these are all styled using their individual selectors. Therefore plugin authors who want to use this style must either use one of these selectors (that probably do not fit the use-case at all) or recreate the style manually. Therefore I propose to standardize these style rules for a specific class, for example something like delete-button or delete-link.

Change History (13)

#1 @swissspidy
2 years ago

  • Component changed from General to Administration
  • Focuses administration removed

#2 @afercia
18 months ago

Related: #35126.

#3 @afercia
18 months ago

Thinking at #35126 where a specific class .button-link-delete was added for this purpose, it just makes sense to me to do the same thing for links too.

#4 @flixos90
18 months ago

  • Milestone changed from Awaiting Review to 4.8

#5 @jbpaul17
15 months ago

  • Keywords needs-patch added

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


15 months ago

#7 @jbpaul17
15 months ago

  • Milestone changed from 4.8 to 4.8.1

Per yesterday's bug scrub, we're going to punt this to 4.8.1.

#8 @afercia
15 months ago

Worth noting [40052] introduced .button-link-delete for <button> elements that look like links. Something similar could be done for the links.

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


13 months ago

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


12 months ago

#11 @jbpaul17
12 months ago

  • Milestone changed from 4.8.1 to 4.9

Per today's bug scrub, we'll punt this as the focus for 4.8.1 is regressions only.

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


10 months ago

#13 @jbpaul17
10 months ago

  • Milestone changed from 4.9 to Future Release

Punting to Future Release per today's 4.9 bug scrub.

Note: See TracTickets for help on using tickets.