Title: bulk_edit_custom_box
Published: April 25, 2014
Last modified: May 20, 2026

---

# do_action( ‘bulk_edit_custom_box’, string $column_name, string $post_type )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/?output_format=md#parameters)
 * [More Information](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/?output_format=md#wp--skip-link--target)

Fires once for each column in Bulk Edit mode.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/?output_format=md#parameters)󠁿

 `$column_name`string

Name of the column to edit.

`$post_type`string

The post type slug.

## 󠀁[More Information](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/?output_format=md#more-information)󠁿

`bulk_edit_custom_box` is an action that lets plugin print inputs for custom columns
when bulk editing. This action is called one time for each custom column. Custom
columns are added with the [manage_edit-${post_type}_columns](https://codex.wordpress.org/Plugin_API/Filter_Reference/manage_edit-post_type_columns)
filter. To save the data from the custom inputs, hook the [save_post](https://developer.wordpress.org/reference/hooks/save_post/)
action.

Note that the action function is passed neither the post ID nor any existing value
for the column.

See [quick_edit_custom_box](https://developer.wordpress.org/reference/hooks/quick_edit_custom_box/#Examples)
for basis.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/?output_format=md#source)󠁿

    ```php
    do_action( 'bulk_edit_custom_box', $column_name, $screen->post_type );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-posts-list-table.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/class-wp-posts-list-table.php#L2091)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/class-wp-posts-list-table.php#L2091-L2091)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/?output_format=md#related)󠁿

| Used by | Description | 
| [WP_Posts_List_Table::inline_edit()](https://developer.wordpress.org/reference/classes/wp_posts_list_table/inline_edit/)`wp-admin/includes/class-wp-posts-list-table.php` |

Outputs the hidden row displayed when inline editing

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 4 content](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/?output_format=md#comment-content-4541)
 2.    [Akira Tachibana](https://profiles.wordpress.org/atachibana/)  [  6 years ago  ](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/#comment-4541)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fbulk_edit_custom_box%2F%23comment-4541)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fbulk_edit_custom_box%2F%23comment-4541)
 4.  (From Codex)
      **Creating Inputs**
 5.  Reuse function display_custom_quickedit_book from [quick_edit_custom_box](https://developer.wordpress.org/reference/hooks/quick_edit_custom_box/#Creating_Inputs)
 6.      ```php
         add_action( 'bulk_edit_custom_box', 'display_custom_quickedit_book', 10, 2 );
         ```
     
 7.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fbulk_edit_custom_box%2F%3Freplytocom%3D4541%23feedback-editor-4541)
 8.   [Skip to note 5 content](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/?output_format=md#comment-content-4542)
 9.    [Akira Tachibana](https://profiles.wordpress.org/atachibana/)  [  6 years ago  ](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/#comment-4542)
 10. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fbulk_edit_custom_box%2F%23comment-4542)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fbulk_edit_custom_box%2F%23comment-4542)
 11. (From Codex)
      **Saving Data**
 12. Unlike quick edit’s data saving process, we’ll save via Ajax calls.
 13.     ```php
         add_action( 'wp_ajax_save_bulk_edit_book', 'save_bulk_edit_book' );
         function save_bulk_edit_book() {
         	// TODO perform nonce checking
         	// get our variables
         	$post_ids           = ( ! empty( $_POST[ 'post_ids' ] ) ) ? $_POST[ 'post_ids' ] : array();
         	$book_author  = ( ! empty( $_POST[ 'book_author' ] ) ) ? $_POST[ 'book_author' ] : null;
         	$inprint = !! empty( $_POST[ 'inprint' ] );
     
         	// if everything is in order
         	if ( ! empty( $post_ids ) && is_array( $post_ids ) ) {
         		foreach( $post_ids as $post_id ) {
         			update_post_meta( $post_id, 'book_author', $book_author );
         			update_post_meta( $post_id, 'inprint', $inprint );
         		}
         	}
     
         	die();
         }
         ```
     
 14.  * Nonsense, you can use save_post hook, as stated in the More Information section
        above.
      * [Marian Kadanka](https://profiles.wordpress.org/mariankadanka/) [5 years ago](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/#comment-5381)
 15.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fbulk_edit_custom_box%2F%3Freplytocom%3D4542%23feedback-editor-4542)
 16.  [Skip to note 6 content](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/?output_format=md#comment-content-4543)
 17.   [Akira Tachibana](https://profiles.wordpress.org/atachibana/)  [  6 years ago  ](https://developer.wordpress.org/reference/hooks/bulk_edit_custom_box/#comment-4543)
 18. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fbulk_edit_custom_box%2F%23comment-4543)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fbulk_edit_custom_box%2F%23comment-4543)
 19. (From Codex)
      **Calling Ajax**
 20. Our updated scripts/admin_edit.js from [quick_edit_custom_box](https://developer.wordpress.org/reference/hooks/quick_edit_custom_box/#Examples).
 21.     ```php
         (function($) {
         	// we create a copy of the WP inline edit post function
         	var $wp_inline_edit = inlineEditPost.edit;
         	// and then we overwrite the function with our own code
         	inlineEditPost.edit = function( id ) {
         		// "call" the original WP edit function
         		// we don't want to leave WordPress hanging
         		$wp_inline_edit.apply( this, arguments );
     
         		// now we take care of our business
     
         		// get the post ID
         		var $post_id = 0;
         		if ( typeof( id ) == 'object' )
         			$post_id = parseInt( this.getId( id ) );
     
         		if ( $post_id > 0 ) {
         			// define the edit row
         			var $edit_row = $( '#edit-' + $post_id );
         			var $post_row = $( '#post-' + $post_id );
     
         			// get the data
         			var $book_author = $( '.column-book_author', $post_row ).html();
         			var $inprint = $( '.column-inprint', $post_row ).attr('checked');
     
         			// populate the data
         			$( ':input[name="book_author"]', $edit_row ).val( $book_author );
         			$( ':input[name="inprint"]', $edit_row ).attr('checked', $inprint );
         		}
         	};
     
         	$( document ).on( 'click', '#bulk_edit', function() {
         		// define the bulk edit row
         		var $bulk_row = $( '#bulk-edit' );
     
         		// get the selected post ids that are being edited
         		var $post_ids = new Array();
         		$bulk_row.find( '#bulk-titles' ).children().each( function() {
         			$post_ids.push( $( this ).attr( 'id' ).replace( /^(ttle)/i, '' ) );
         		});
     
         		// get the data
         		var $book_author = $bulk_row.find( 'textarea[name="book_author"]' ).val();
         		var $inprint = $bulk_row.find( 'input[name="inprint"]' ).attr('checked') ? 1 : 0;
     
         		// save the data
         		$.ajax({
         			url: ajaxurl, // this is a variable that WordPress has already defined for us
         			type: 'POST',
         			async: false,
         			cache: false,
         			data: {
         				action: 'save_bulk_edit_book', // this is the name of our WP AJAX function that we'll set up next
         				post_ids: $post_ids, // and these are the 2 parameters we're passing to our function
         				book_author: $book_author,
         				inprint: $inprint
         			}
         		});
         	});
         })(jQuery);
         ```
     
 22.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fbulk_edit_custom_box%2F%3Freplytocom%3D4543%23feedback-editor-4543)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fbulk_edit_custom_box%2F)
before being able to contribute a note or feedback.