#6815 closed enhancement (fixed)
Batch editing for posts
Reported by: | matt | Owned by: | ryan |
---|---|---|---|
Milestone: | 2.7 | Priority: | normal |
Severity: | normal | Version: | 2.5 |
Component: | Administration | Keywords: | blessed |
Focuses: | Cc: |
Description
One of the things in the original HC mockup that was cut from 2.5 was batch editing of posts, meant to provide a way to edit titles, tags, categories, publish state, and author in a batch fashion from the edit screen.
First we need some mockups of how this should work, which should be attached to this ticket, and then we can work on getting it in.
Attachments (3)
Change History (29)
#2
@
16 years ago
Here's a plugin that allows ajax editing of comments from the manage posts screen:
http://uwmike.com/wordpress/wp-cats/
I did something similar about a year ago, hacking the manage screen. It was rather simple. The edit.php screen had hidden divisions for categories, author and the date picker. Clicking on a certain cell would attach that hidden division to that cell so you could change it (ie: click on categories would attach the floating category drop down list and show it). Once you clicked to close it, the changes were saved via AJAX.
For titles I simply made it an edit in place. A similar approach should work here. The javascript side of it should actually be a little simpler now, as jQuery 1.2.x has methods built in to get the offset of an element, which makes it easy for positioning.
#5
@
16 years ago
A few issues that need to be sorted out. First, the page's children need to somehow be removed from the page parent dropdown. I'm not sure how the child pages would be distinguished using just JS. Second, I'm not sure how to best collect the mass of post data and make the Ajax request to save everything. We could give each of the input fields a name like "title-ID" and use the jQuery form plugin to serialize the fields. That's just a lot to sort through on the PHP side. I can't think of any other options though.
#6
@
16 years ago
Shift change functionality has been setup. If you have multiple edit rows open and hold shift while changing a select field or clicking a checkbox, the change will be made to each of the open rows. The button may need to be changed from shift to Command/Ctrl because Shift does some funky text selection stuff. Batch editing text fields is a little trickier. For now I've set it up so that if you hold shift while blurring the text field all the open rows are changed. I'm not sure how intuitive that is but again, I don't have any better ideas.
#7
follow-up:
↓ 8
@
16 years ago
At the moment this patch tries to do both quick editing and batch editing at the same time. Perhaps we should split them in separate tasks: quick edit on per post basis (one post only) could potentially include the content too, would be something similar to the quick press on the dashboard.
Batch editing would be available from the "Actions" drop-down, would open one editing dialog and add the selected posts (selectable with the checkboxes), then allow editing of timestamp, author, category, tag and publish status for all the posts at the same time, setting the same values. That IMHO is what's expected from batch processing. Of course there will be a way to choose which values are to be edited.
#8
in reply to:
↑ 7
@
16 years ago
That sounds like a sensible way of setting it up. I was just trying to combine interfaces so users wouldn't have to bounce between two different interfaces to make quick edits to single or multiple posts. Let me know what the next steps should be.
#9
@
16 years ago
Splitting quick and batch edit sounds good. Let's focus on nailing down quick edit first.
Right now, I'm getting three inline-data AJAX requests when loading the pages or posts. Clicking "Quick Edit" results in three edit fields popping up. This is with FF and Safari.
#10
follow-up:
↓ 12
@
16 years ago
Something must have gone awry in the transfer. Only one Ajax request should be made on load and obviously only one edit row should popup. I'll go ahead and finish out implementation (with saving and no batch editing) and upload a new diff.
#11
@
16 years ago
I fixed it with document ready. I also fixed some PHP warnings in get_edit_data() and display_edit_row() for using uninitialized variables.
#12
in reply to:
↑ 10
@
16 years ago
Replying to aaron_guitar:
I'll go ahead and finish out implementation (with saving and no batch editing) and upload a new diff.
Good to know so we don't duplicate. Can do the styling after. Perhaps we need to add a hook too so plugins can customize it.
#13
@
16 years ago
Just posted final integration of Manageable. I haven't done too much cross-browser checking. I do know that Safari has issues updating the postXml variable after saving. I'm using jQuery's replaceWith method so this might be an issue with jQuery.
I'll let you guys take it from here. Let me know if you have any questions.
#15
@
16 years ago
It's in. I made some API changes to edit_post(), post_rows(), and _wp_translate_postdata() so you could pass the data along instead of having to fuss with globals. I reverted the taxonomy.php change since adding a space after the comma breaks other things. Looks like this broke tags editing in quick edit, so that will need attention.
#16
@
16 years ago
The plugin "Admin Management Xtended" seems to have a more elegant user-friendly interface. Just a thought for consideration.
#18
@
16 years ago
One thing that should probably be thought about is how revisions are handled on inline edits.
#23
@
16 years ago
With the bulk edit it is possible to change a page to be its own parent. I just did this and it locked up Apache and I had to restart it.
The styling looks good. I just don't like that it takes up so much of the screen real estate. I know it's not my thing anymore, but I thought I'd throw that out there.
Plugin that does batch editing of categories.
http://robm.me.uk/projects/plugins/wordpress/batch-categories