Make WordPress Core

Opened 16 years ago

Closed 8 years ago

Last modified 6 years ago

#9777 closed enhancement (fixed)

Add "delete" button to term pages

Reported by: ramiy's profile ramiy Owned by: adamsilverstein's profile adamsilverstein
Milestone: 4.8 Priority: normal
Severity: minor Version: 4.8
Component: Taxonomy Keywords: good-first-bug has-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 (21)

9777.diff (168.0 KB) - added by cklosows 13 years ago.
Creates Red "Delete" link on the edit page of a category or tag.
9777.2.diff (2.5 KB) - added by cklosows 13 years ago.
Removing modifications to minified CSS
9777.2.2.diff (1.5 KB) - added by cklosows 10 years ago.
Refreshing the original patch in a more re-usable way.
9777.3.diff (1.9 KB) - added by cklosows 10 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 10 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 10 years ago.
9777.5.diff (2.1 KB) - added by bradt 10 years ago.
Screen Shot 2014-11-14 at 2.07.52 PM.png (41.2 KB) - added by bradt 10 years ago.
9777.6.diff (2.9 KB) - added by bradt 10 years ago.
Replaced onclick attribute with proper JS.
9777.7.diff (3.0 KB) - added by DrewAPicture 10 years ago.
refresh
Screen Shot 2015-03-11 at 11.26.30 AM.png (190.5 KB) - added by ryan 10 years ago.
9777.7.diff on Macnchrome
IMG_0761.PNG (163.4 KB) - added by ryan 10 years ago.
9777.7.diff on iPhone 6+.
9777.8.diff (3.7 KB) - added by bradt 10 years ago.
Improved the UI.
Screen Shot 2015-03-20 at 5.04.09 PM.png (311.5 KB) - added by bradt 10 years ago.
Screen Shot 2015-03-20 at 5.13.15 PM.png (85.0 KB) - added by bradt 10 years ago.
9777.9.patch (3.2 KB) - added by cklosows 8 years ago.
Patch refresh
9777.10.patch (3.3 KB) - added by cklosows 8 years ago.
Add inline comment to make it clear why the remove_query_arg is necessary.
9777.11.patch (3.3 KB) - added by cklosows 8 years ago.
Replace the default category check to using the capability check as it's implicitly checked.
9777.9.diff (4.2 KB) - added by MatheusGimenez 8 years ago.
Fix JS confirm box to prevent delete by mistake
9777.10.diff (4.1 KB) - added by MatheusGimenez 8 years ago.
Remove var_dump() (sorry, rs)
9777.11.diff (766 bytes) - added by Chouby 8 years ago.

Download all attachments as: .zip

Change History (88)

#1 in reply to: ↑ description @ramiy
16 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
16 years ago

  • Severity changed from major to minor

#3 @Denis-de-Bernardy
16 years ago

  • Milestone changed from 2.8 to Future Release

punting pending patch

#4 @ramiy
15 years ago

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

#5 @solarissmoke
14 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
14 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
14 years ago

Huh, never noticed that until now.

#8 @jorbin
14 years ago

  • Keywords ux-feedback added

#9 follow-up: @scribu
14 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
14 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
14 years ago

  • Keywords needs-patch added

#12 follow-up: @SergeyBiryukov
14 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
14 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
14 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
14 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
14 years ago

  • Keywords needs-patch added

@cklosows
13 years ago

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

#17 @cklosows
13 years ago

  • Cc cklosowski@… added

#18 @cklosows
13 years ago

  • Keywords has-patch added

#19 @cklosows
13 years ago

  • Keywords needs-patch removed

#20 follow-up: @SergeyBiryukov
13 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
13 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
13 years ago

Removing modifications to minified CSS

#22 @ramiy
12 years ago

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

#23 @helen
11 years ago

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

#24 @nacin
11 years ago

  • Component changed from Administration to Taxonomy
  • Focuses administration added

@cklosows
10 years ago

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

#25 @cklosows
10 years ago

  • Keywords needs-refresh removed

#26 @cklosows
10 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
10 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
10 years ago

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

@cklosows
10 years ago

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

#28 @johnbillion
10 years ago

  • Milestone changed from Future Release to 4.1

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


10 years ago

@ocean90
10 years ago

#30 @ocean90
10 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 10 years ago by ocean90 (previous) (diff)

@bradt
10 years ago

#31 @bradt
10 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
10 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
10 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
10 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
10 years ago

Replaced onclick attribute with proper JS.

#35 @iseulde
10 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.


10 years ago

@DrewAPicture
10 years ago

refresh

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


10 years ago

@ryan
10 years ago

9777.7.diff on Macnchrome

@ryan
10 years ago

9777.7.diff on iPhone 6+.

#38 @ryan
10 years 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
10 years ago

Improved the UI.

#39 @bradt
10 years ago

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

#40 follow-up: @ramiy
10 years 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
10 years ago

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

Just checked the patch and it still applies cleanly.

#42 @ramiy
10 years ago

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

#43 @obenland
10 years ago

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

#44 @obenland
10 years ago

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

#45 @obenland
10 years ago

  • Milestone changed from 4.3 to Future Release

No traction in 4.3.

#46 @bradt
10 years ago

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

#47 @wonderboymusic
9 years ago

  • Keywords good-first-bug added

#48 @tzon
9 years 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
9 years ago

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

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


9 years ago

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


9 years ago

#52 @ramiy
8 years ago

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

@cklosows
8 years ago

Patch refresh

#53 @cklosows
8 years ago

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

@cklosows
8 years ago

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

#54 @johnbillion
8 years 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
8 years ago

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

#55 @ramiy
8 years ago

Related: #36574 (Redesign term pages)

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

@MatheusGimenez
8 years ago

Fix JS confirm box to prevent delete by mistake

@MatheusGimenez
8 years ago

Remove var_dump() (sorry, rs)

#56 @MatheusGimenez
8 years ago

  • Keywords needs-patch removed

#57 @swissspidy
8 years ago

  • Keywords has-patch added

#58 @arshidkv12
8 years ago

  • Version set to trunk

js file wp_enqueue_script('admin-tags'); not working on my system. I think, it is not registered.

#59 @maguiar
8 years ago

Tested latest patch, working as expected:

https://cl.ly/1V060l032m0Z/9777.gif

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


8 years ago

#61 @adamsilverstein
8 years ago

  • Owner changed from helen to adamsilverstein

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


8 years ago

#63 follow-up: @adamsilverstein
8 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 40655:

Taxonomy: Add a "delete" button on term edit page.

Add a 'delete' link next to the update button on the term edit screen so you can delete a term while you are reviewing it's details.

Props cklosows, bradt, ocean90, johnbillion, DrewAPicture, ryan, MatheusGimenez, maguiar.
Fixes #9777.

@Chouby
8 years ago

#64 in reply to: ↑ 63 @Chouby
8 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

40655 introduced an error in the html markup output. I propose a patch in 9777.11.diff

#65 @rachelbaker
8 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 40668:

Taxonomy: Remove extraneous ' included in Term delete markup.

Unmatched single quotation mark after the delete link href was introduced in r40655.

Props Chouby.
Fixes #9777.

#66 @adamsilverstein
8 years ago

Thanks for catching and fixing that @Chouby.

#67 @afercia
6 years ago

In 44621:

Taxonomy: Remove extra padding around buttons on term edit page.

Props monikarao, mukesh27, chetan200891.
See #9777.
Fixes #45183.

Note: See TracTickets for help on using tickets.