From 7773a713c4ff4947e63b0fb2547f560daa7fb142 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Thu, 12 May 2016 15:43:48 +0000 Subject: [PATCH] Posts: Fire a `post_action_{$action}` action for a custom post action request. Props jfarthing84, Mte90, brianvan, sudar, DrewAPicture. Fixes #27056. git-svn-id: https://develop.svn.wordpress.org/trunk@37424 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/post.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/wp-admin/post.php b/src/wp-admin/post.php index 5333b5f306..b9a3026581 100644 --- a/src/wp-admin/post.php +++ b/src/wp-admin/post.php @@ -275,6 +275,17 @@ case 'preview': exit(); default: + /** + * Fires for a given custom post action request. + * + * The dynamic portion of the hook name, `$action`, refers to the custom post action. + * + * @since 4.6.0 + * + * @param int $post_id Post ID sent with the request. + */ + do_action( "post_action_{$action}", $post_id ); + wp_redirect( admin_url('edit.php') ); exit(); } // end switch