WordPress.org

Make WordPress Core

Opened 8 years ago

Last modified 4 days ago

#9777 assigned enhancement

Add "delete" button to term pages

Reported by: ramiy Owned by: helen
Milestone: 4.8 Priority: normal
Severity: minor Version:
Component: Taxonomy Keywords: good-first-bug needs-patch
Focuses: ui, administration Cc:

Description

Add "delete" button to "edit category" menu so i can delete the category and not only edit it. this is a very useful feature that is missing in this menu.

LOCATION:

Admin -> Posts -> Categories -> Edit Category

URL:

http://www.site.org/wp-admin/categories.php?action=edit&cat_ID=302

Attachments (18)

9777.diff (168.0 KB) - added by cklosows 5 years ago.
Creates Red "Delete" link on the edit page of a category or tag.
9777.2.diff (2.5 KB) - added by cklosows 5 years ago.
Removing modifications to minified CSS
9777.2.2.diff (1.5 KB) - added by cklosows 2 years ago.
Refreshing the original patch in a more re-usable way.
9777.3.diff (1.9 KB) - added by cklosows 2 years ago.
Properly handling the redirections after deletes by removing the query args of deleted term ID as well as the action, after the wp_delete_term
9777.4.diff (2.0 KB) - added by cklosows 2 years ago.
Adding JS to prompt on delete, as well as hiding the delete on the default category.
term-delete.png (8.6 KB) - added by ocean90 2 years ago.
9777.5.diff (2.1 KB) - added by bradt 2 years ago.
Screen Shot 2014-11-14 at 2.07.52 PM.png (41.2 KB) - added by bradt 2 years ago.
9777.6.diff (2.9 KB) - added by bradt 2 years ago.
Replaced onclick attribute with proper JS.
9777.7.diff (3.0 KB) - added by DrewAPicture 22 months ago.
refresh
Screen Shot 2015-03-11 at 11.26.30 AM.png (190.5 KB) - added by ryan 21 months ago.
9777.7.diff on Macnchrome
IMG_0761.PNG (163.4 KB) - added by ryan 21 months ago.
9777.7.diff on iPhone 6+.
9777.8.diff (3.7 KB) - added by bradt 21 months ago.
Improved the UI.
Screen Shot 2015-03-20 at 5.04.09 PM.png (311.5 KB) - added by bradt 21 months ago.
Screen Shot 2015-03-20 at 5.13.15 PM.png (85.0 KB) - added by bradt 21 months ago.
9777.9.patch (3.2 KB) - added by cklosows 4 days ago.
Patch refresh
9777.10.patch (3.3 KB) - added by cklosows 4 days ago.
Add inline comment to make it clear why the remove_query_arg is necessary.
9777.11.patch (3.3 KB) - added by cklosows 4 days ago.
Replace the default category check to using the capability check as it's implicitly checked.

Download all attachments as: .zip

Change History (73)

#1 in reply to: ↑ description @ramiy
8 years ago

  • Milestone changed from 2.9 to 2.8

Replying to ramiy:

Add "delete" button to "edit category" menu so i can delete the category and not only edit it. this is a very useful feature that is missing in this menu.

LOCATION:

Admin -> Posts -> Categories -> Edit Category

URL:

http://www.site.org/wp-admin/categories.php?action=edit&cat_ID=302

#2 @ryan
8 years ago

  • Severity changed from major to minor

#3 @Denis-de-Bernardy
8 years ago

  • Milestone changed from 2.8 to Future Release

punting pending patch

#4 @ramiy
7 years ago

This enhancement is needed at "tag edit menu" too.

#5 @solarissmoke
6 years ago

  • Keywords dev-feedback added; Admin Categories Edit delete usability removed

There are quite a lot of places where the "edit" screen doesn't let you delete:

  • Admin -> Users
  • Admin -> Media
  • Admin -> Links
  • Admin -> Links -> Link Categories

plus those mentioned above.

Do they all want changing?

#6 @ramiy
6 years ago

  • Cc ramiy added

Replying to solarissmoke:

For me, as a user, it would be easier to delete category/tag/taxonomy/media/link/user/post/page from the "edit" screen. The "edit" screen shows me all the infoamation about this tag/cat/post and i can decide if i need it or not.

#7 @scribu
6 years ago

Huh, never noticed that until now.

#8 @jorbin
6 years ago

  • Keywords ux-feedback added

#9 follow-up: @scribu
6 years ago

  • Keywords ui-feedback added; dev-feedback ux-feedback removed

I think it's safe to say that this is a good idea, for all screens mentioned by solarissmoke.

Just need to decide how it should look like.

I'm thinking of a red link, next to the Update button.

#10 in reply to: ↑ 9 @ramiy
6 years ago

Replying to scribu:

I think it's safe to say that this is a good idea.

thank you scribu. hope to see this in 3.2.

#11 @SergeyBiryukov
5 years ago

  • Keywords needs-patch added

#12 follow-up: @SergeyBiryukov
5 years ago

  • Keywords needs-patch removed

Actually, all of the mentioned list screens already have the Delete links in 3.2:

  • Posts → Categories
  • Posts → Tags
  • Media → Library
  • Links → All Links
  • Links → Link Categories
  • Users → All Users

Perhaps a separate link on edit screens is no longer needed?

#13 in reply to: ↑ 12 @ramiy
5 years ago

Sergey, we are no talking about the "Quick Edit" on

  • Posts → Categories
  • /wp-admin/edit-tags.php?taxonomy=category

We are talking about the "Category Edit" screen.

  • Posts → Categories → SomeCategory
  • /wp-admin/edit-tags.php?action=edit&taxonomy=category&tag_ID=11&post_type=post

#14 @SergeyBiryukov
5 years ago

Yeah, I see it. I assumed it was only needed due to lack of the Delete links in Quick Edit in 3.1. Now that we have them, is it still necessary on Edit screens?

#15 @ramiy
5 years ago

Yes, it's needed! i dont use the "Quick Edit" and when i want to delete some cat/tag/ct i go to it's edit page to see all the parameters before i delete it. And the current edit page has no "Delete" button and it's frustrating.

#16 @SergeyBiryukov
5 years ago

  • Keywords needs-patch added

@cklosows
5 years ago

Creates Red "Delete" link on the edit page of a category or tag.

#17 @cklosows
5 years ago

  • Cc cklosowski@… added

#18 @cklosows
5 years ago

  • Keywords has-patch added

#19 @cklosows
5 years ago

  • Keywords needs-patch removed

#20 follow-up: @SergeyBiryukov
5 years ago

No need to patch minified .css and .js, they'll quickly become stale.

With #19592, they are now updated automatically when the .dev versions are committed.

#21 in reply to: ↑ 20 @cklosows
5 years ago

Replying to SergeyBiryukov:

No need to patch minified .css and .js, they'll quickly become stale.

With #19592, they are now updated automatically when the .dev versions are committed.

Sounds good, I'll fix that up tonight and recreate my patch.

@cklosows
5 years ago

Removing modifications to minified CSS

#22 @ramiy
3 years ago

  • Summary changed from Usability : add delete button to "edit category" menu to Usability : add delete button to "edit category" screen

#23 @helen
3 years ago

  • Focuses ui added
  • Keywords needs-refresh added; ui-feedback removed

#24 @nacin
3 years ago

  • Component changed from Administration to Taxonomy
  • Focuses administration added

@cklosows
2 years ago

Refreshing the original patch in a more re-usable way.

#25 @cklosows
2 years ago

  • Keywords needs-refresh removed

#26 @cklosows
2 years ago

Actually there's a bug in the patch, the URL attempts to get back to the deleted term. Will fix that and resubmit.

@cklosows
2 years ago

Properly handling the redirections after deletes by removing the query args of deleted term ID as well as the action, after the wp_delete_term

#27 @cklosows
2 years ago

  • Summary changed from Usability : add delete button to "edit category" screen to Usability : add delete button to edit-tags.php

@cklosows
2 years ago

Adding JS to prompt on delete, as well as hiding the delete on the default category.

#28 @johnbillion
2 years ago

  • Milestone changed from Future Release to 4.1

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


2 years ago

@ocean90
2 years ago

#30 @ocean90
2 years ago

The delete links needs a better place, see term-delete.png. The link shouldn't be that close to the update button.

Last edited 2 years ago by ocean90 (previous) (diff)

@bradt
2 years ago

#31 @bradt
2 years ago

  • Tweaked the position so it's not so snug to the button
  • Removed the underline to be consistent with other action links in the dashboard

Tested in latest FF, Chrome, Safari on OS X.

#32 @helen
2 years ago

  • Keywords 4.2-early added
  • Milestone changed from 4.1 to Future Release

We're in beta now - let's grab this in 4.2. If another committer really wants to own this, it can probably be rescued for 4.1. I don't really like adding an onclick attribute, though.

#33 @bradt
2 years ago

I don't really like adding an onclick attribute, though.

Agreed.

In fact, I hate prompts. Undo links are a much better experience.

Ideally we'd show an undo link in the delete notice instead of a prompting before delete.

#34 @cklosows
2 years ago

Then we should look at the action links on the taxonomy list page. This mimics the exact same mechinisim and prompt for deletion.

@bradt
2 years ago

Replaced onclick attribute with proper JS.

#35 @iseulde
2 years ago

  • Milestone changed from Future Release to 4.2

has-patch 4.2-early so moving to 4.2.

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


22 months ago

@DrewAPicture
22 months ago

refresh

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


21 months ago

@ryan
21 months ago

9777.7.diff on Macnchrome

@ryan
21 months ago

9777.7.diff on iPhone 6+.

#38 @ryan
21 months ago

  • Milestone changed from 4.2 to Future Release

Punting enhancements from 4.2 per the bug scrub. I attached desktop and mobile screenshots to help move the ticket along when 4.3 opens.

@bradt
21 months ago

Improved the UI.

#39 @bradt
21 months ago

Submitted a new patch with an updated UI in line with what @johnbillion and @DrewAPicture discussed on Slack.

#40 follow-up: @ramiy
21 months ago

We can also make it two columns screen, like the post edit screen.

On the right sidebar, show the "Publish" metabox with action buttons (Update & Delete) and other term info like the taxonomy name and the post count.

#41 in reply to: ↑ 40 @bradt
20 months ago

@ramily IMO it's not worth going to a two column layout.

Just checked the patch and it still applies cleanly.

#42 @ramiy
20 months ago

Two column layout for taxonomy terms - maybe in wordpress 5.2
;-)

#43 @obenland
19 months ago

  • Owner set to helen
  • Status changed from new to assigned

#44 @obenland
19 months ago

  • Keywords 4.2-early removed
  • Milestone changed from Future Release to 4.3

#45 @obenland
18 months ago

  • Milestone changed from 4.3 to Future Release

No traction in 4.3.

#46 @bradt
16 months ago

Just re-tested against trunk, patch still applies cleanly.

#47 @wonderboymusic
15 months ago

  • Keywords good-first-bug added

#48 @tzon
14 months ago

9777.7 screenshot looks better than 9777.8 screenshot with delete button to the right of the Update button.
The delete button from 9777.7 worked correctly.

#49 @bradt
12 months ago

Just re-tested against trunk, patch still applies cleanly.

This ticket was mentioned in Slack in #design by ocean90. View the logs.


8 months ago

This ticket was mentioned in Slack in #design by hugobaeta. View the logs.


7 months ago

#52 @ramiy
3 weeks ago

  • Summary changed from Usability : add delete button to edit-tags.php to Add "delete" button to term pages

@cklosows
4 days ago

Patch refresh

#53 @cklosows
4 days ago

Retested, and patch needed a refresh. Removed some CSS that was no longer needed.

@cklosows
4 days ago

Add inline comment to make it clear why the remove_query_arg is necessary.

#54 @johnbillion
4 days ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from Future Release to 4.8
  • Version 2.7.1 deleted

Thanks for the patch, @cklosows!

This button needs to be wrapped in a current_user_can( 'delete_term', $tag_ID ) check. This will also negate the need for the default category check, which is now handled inside the cap check since #35614.

@cklosows
4 days ago

Replace the default category check to using the capability check as it's implicitly checked.

#55 @ramiy
4 days ago

Related: #36574 (Redesign term pages)

The "delete" button can be on the sidebar, inside the "Publish" meta box.

Note: See TracTickets for help on using tickets.