acp/editing/save

The Filter acp/editing/save allows you to store the editable column value to the database. This filter is mainly use for third party plugin columns.

Usage

There are 2 ways to hook into acp/editing/save.

  • acp/editing/save – filter for every column
  • acp/editing/save/[column-type] – filter for a specific column-type
/**
 * Called when a column is saved, but the saving is not handled by Admin Columns core
 * This should be used for saving columns that are editable but do not have their own AC_Column class
 * The first parameter, $result, should only be used if an error occurs
 *
 * Filter acp/editing/save
 * Filter acp/editing/save/{$column_type}
 *
 * @param WP_Error  $result
 * @param int       $id
 * @param mixed     $value
 * @param AC\Column $column
 */
function my_acp_editing_save_value( $result, $id, $value, $column ) {

	// Check for specific $column or $editable_model
	// Save the $value for a specific $object_id and pass the $result

	return $result;
}

add_filter( 'acp/editing/save', 'my_acp_editing_save_value', 10, 4 );
add_filter( 'acp/editing/save/{$column_type}', 'my_acp_editing_save_value', 10, 4 );

Legacy

The following filters are replaced by acp/editing/save since Admin Columns Pro 4.0.
cac/editable/column_save
cac/editable/column_save/column=[column name]