WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 14 months ago

#28112 new enhancement

bulk_edit_posts() function needs an action hook

Reported by: helgatheviking Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.9
Component: Quick/Bulk Edit Keywords: dev-feedback needs-docs has-patch
Focuses: Cc:

Description

Currently, the only method that I can find to save additional data in via bulk edit requires using an .ajax() call.

This could be avoided if bulk_edit_posts() had a simple action hook at the end before it returns it's results.

do_action( 'bulk_edit_posts', $post_data );

return array( 'updated' => $updated, 'skipped' => $skipped, 'locked' => $locked );

Attachments (1)

28112.diff (663 bytes) - added by Mte90 15 months ago.

Download all attachments as: .zip

Change History (7)

#1 @helgatheviking
4 years ago

Some JS triggers in inline-edit-posts.js wouldn't go astray either. For example:

t.trigger( "setBulk-inlineedit" );

#2 @helen
4 years ago

I'm enjoying your bulk/quick edit tickets very much - just want to note (as I probably have elsewhere) that this is one of those times where we'd be better off with a revamp and that any additions to what exists need to be considered ever-more carefully in that light. A Backbone-ified bulk/quick edit has been tossed around as an idea a couple times, if you want to look into that.

#3 @helgatheviking
4 years ago

I'm flattered! Even if I didn't ever think that tickets could be 'enjoyed'. I've been revamping one of my plugins that relies heavily on quick/bulk edit and have come to realize that those areas need some love... particularly more hooks/filters for developers. Unfortunately, I don't know the first thing about backbone so I don't know that I'd be much use there.

Pertaining to this issue... so are you saying that admin hooks/triggers will not be added in favor of a possible, eventual overhaul? It seems a shame to lose out on some hooks while that maybe happens.

All that said, my digging did eventually bring me to the revelation that bulk edit is processed by a loop that hits wp_insert_post() so actually the ability to save bulk edit details doesn't require ajax at all and can run on the exact same save_post routine that quick edit and meta boxes already use.

#4 @chriscct7
2 years ago

  • Keywords needs-patch added

@Mte90
15 months ago

#5 @Mte90
15 months ago

  • Keywords dev-feedback needs-docs added; needs-patch removed

The patch is very simple, contain the hook with a little bit of documentation (that require a feedback) in the bulk_edit_posts() function.

#6 @Mte90
14 months ago

  • Keywords has-patch added
Note: See TracTickets for help on using tickets.