Fires once for each column in Quick Edit mode.
Parameters
$column_name
string- Name of the column to edit.
$post_type
string- The post type slug, or current screen name if this is a taxonomy list table.
$taxonomy
string- The taxonomy name, if any.
Source
do_action( 'quick_edit_custom_box', $column_name, $screen->post_type, '' );
Changelog
Version | Description |
---|---|
2.7.0 | Introduced. |
Example migrated from Codex:
Setting Existing Values
Populating inputs with existing values takes a bit of trickery. One can’t simply access the
$post
global because when this action is run, $post refers only to the last post (the quick edit inputs are created only once, and cloned as needed when quick editing a column). There are two parts: storing the data on the page and hookinginlineEditPost.edit
to set the input values. If the quick-edit columns are also displayed as custom columns, the data is already in the table. Otherwise, it can be added as hidden elements to an existing custom column.Hooking
inlineEditPost.edit
must be done in a JS script, loaded after js/_enqueues/admin/inline-edit-post.js. The original method is saved and replaced with a new one which calls the original. This particular technique is a simple example of aspect-oriented programming.PHP:
scripts/admin_edit.js:
Example migrated from Codex:
Creating Inputs
Example migrated from Codex:
Saving Data
Data entered in custom inputs can be saved by hooking the save_post action.