Make WordPress Core

Opened 16 years ago

Closed 16 years ago

Last modified 14 years ago

#6815 closed enhancement (fixed)

Batch editing for posts

Reported by: matt's profile matt Owned by: ryan's profile 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)

manageable.patch (27.9 KB) - added by aaron_guitar 16 years ago.
Initial integration of Manageable. Saving not yet implemented.
6815.diff (28.5 KB) - added by ryan 16 years ago.
6815.2.diff (28.7 KB) - added by aaron_guitar 16 years ago.
Integration of manageable with saving

Download all attachments as: .zip

Change History (29)

#1 @ryan
16 years ago

Plugin that does batch editing of categories.

http://robm.me.uk/projects/plugins/wordpress/batch-categories

#2 @intoxination
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.

#3 @ryan
16 years ago

  • Milestone changed from 2.9 to 2.7

#5 @aaron_guitar
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.

@aaron_guitar
16 years ago

Initial integration of Manageable. Saving not yet implemented.

#6 @aaron_guitar
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: @azaozz
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 @aaron_guitar
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 @ryan
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: @aaron_guitar
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 @ryan
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.

@ryan
16 years ago

#12 in reply to: ↑ 10 @azaozz
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.

@aaron_guitar
16 years ago

Integration of manageable with saving

#13 @aaron_guitar
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.

#14 @ryan
16 years ago

(In [8857]) Inline editing. First cut. Props Aaron Harp. see #6815

#15 @ryan
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 @thee17
16 years ago

The plugin "Admin Management Xtended" seems to have a more elegant user-friendly interface. Just a thought for consideration.

#17 @ryan
16 years ago

(In [8861]) Don't assign default to pass-by-ref var. Not compatible with all PHP versions. see #6815

#18 @aaron_guitar
16 years ago

One thing that should probably be thought about is how revisions are handled on inline edits.

#19 @azaozz
16 years ago

(In [8917]) Add nonces to quick edit, see #6815

#20 @azaozz
16 years ago

(In [8943]) Sytling and improvements to inline editing, see #6815

#21 @azaozz
16 years ago

(In [8973]) Batch editing, first cut, see #6815

#22 @azaozz
16 years ago

(In [8976]) Batch editing, refresh JS and CSS, see #6815

#23 @aaron_guitar
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.

#24 @azaozz
16 years ago

Page parents should be fixed in [9036]. Yes it takes more screen space, but allows for only one editing row at a time either quick edit or batch edit. Also some boxes can be hidden from the page column settings.

#25 @aaron_guitar
16 years ago

Cool. It's growing on me.

#26 @matt
16 years ago

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

Seems to work well, let's put bugs in new tickets.

Note: See TracTickets for help on using tickets.