Make WordPress Core

Opened 6 years ago

Last modified 45 hours ago

#11302 new enhancement

Bulk editing posts should pre-fill fields with the same value / allow for removal

Reported by: pavelevap Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 2.9
Component: Quick/Bulk Edit Keywords: needs-patch
Focuses: Cc:


All I need is quickly move some posts from one category to another.

How to simulate this problem:

Create 2 posts in Uncategorized category.
Check both of them - Bulk actions - Edit.
There is no category selected even if both posts are in Uncategorized. When I check Category1 and click Update, both posts are now in Uncategorized and also in Category1. But no chance remove them from Uncategorized with Bulk actions.

Change History (20)

comment:1 @pavelevap6 years ago

  • Cc pavelevap@… added

comment:2 @scribu6 years ago

  • Component changed from UI to Administration
  • Keywords needs-patch added

Confirmed behaviour with 2.9-beta2.

comment:3 @scribu6 years ago

  • Component changed from Administration to Quick Edit

Actually, no categories are checked!

comment:4 @scribu6 years ago

  • Milestone changed from 2.9 to 3.0
  • Summary changed from Bulk actions for category change does not work to Can't removeCategories not checked in Quick edit
  • Type changed from defect (bug) to enhancement

The same goes for tags: the tag box will always be empty, even if both posts have one or more tags in common.

I think Quick Edit simply doesn't check similarities between posts at all, although it would be nice.

To get this working right will take some serious patching and a lot of testing. Punting to the next major release.

comment:5 @scribu6 years ago

  • Summary changed from Can't removeCategories not checked in Quick edit to Bulk editing posts should pre-fill fields with the same value

comment:6 @nacin5 years ago

  • Milestone changed from 3.0 to Future Release

No patch, punting.

comment:7 @scribu5 years ago

Related: #12837

comment:8 @chased@…4 years ago

I'd like to add that this seems to also appear when attempting to change Author with Bulk Edit. When doing so, changes are not saved.

comment:9 @helenyhou3 years ago

Closed #21252 as a duplicate

comment:10 @SergeyBiryukov2 years ago

Related: #19859, #24608

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

comment:11 @helen23 months ago

#24608 was marked as a duplicate.

comment:12 @helen23 months ago

  • Summary changed from Bulk editing posts should pre-fill fields with the same value to Bulk editing posts should pre-fill fields with the same value / allow for removal

I could have sworn there was a comment to this effect somewhere already, but repeating it probably won't hurt.

There are two paths to allowing for removal of terms when it comes to UI + flow - that it can only be done when that term is already set for all posts in the selection (pre-filling with a check), or that we implement the indeterminate state (usually indicated by a checkbox with a dash through it) that allows the category to be removed from any posts that have that term set.

Implementation-wise, given that checkboxes don't send in the $_POST array when they aren't checked, a patch probably requires a good deal of thought. As noted in #8690, this is currently an add functionality, not replace. Indeterminate checkboxes are also not standardized in browsers or available in HTML.

Note that this only applies to hierarchical taxonomies. #19859 for non-hierarchical.

comment:13 @ubernaut23 months ago

  • Cc ubernaut@… added

comment:14 @grahamarmfield20 months ago

  • Cc graham.armfield@… added

comment:15 @joshcanhelp11 months ago

This just recently came up in a project. The main issue is removing categories as they can be added in bulk with the current controls. Here are a few simpler options that came to mind:

1) Have the quick edit box react to whether you're already sorting by category in wp-admin. Above the list of posts, you have a category drop-down that shows posts within that category. The bulk edit function could key off of that and select the category you're currently viewing. If you submit and that category is gone, it's removed from the posts selected. This means you'd need to filter, select the posts, bulk edit, deselect, then save.

2) Another way to do this would be to have a separate category list for removal. It would show all categories that have posts assigned, all of them checked by default. You'd select the posts, bulk edit, deselect whatever categories you want to remove, then save. Any post that's selected would have the deselected categories removed.

Either one of those sound feasible?

comment:16 @ubernaut11 months ago

personally i think the third mixed state/dashed indicator is the most elegant and conventional solution to this issue.

comment:17 @joshcanhelp11 months ago

I definitely agree. I just figured one of these might be a good stop-gap solution (particularly the first since it's the least impactful on the UI as a whole).

The mixed-state checkbox, as Helen mentioned, is not available in HTML but there are good ways to implement with JS:


comment:18 @ubernaut11 months ago

interesting never actually knew that guess that's my new thing of the day. thanks for the link!


Last edited 11 months ago by ubernaut (previous) (diff)

comment:19 @SergeyBiryukov45 hours ago

#33205 was marked as a duplicate.

comment:20 @Cyberchicken45 hours ago

@Helen: an old html trick to make checkboxes behave:
<input name="mycheckbox" value="nay" type="hidden">
<input name="mycheckbox" value="yes" type="checkbox">
You'll always be posted eithr a "nay" or a "yes".
Three-state require js for sure.

Note: See TracTickets for help on using tickets.