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         Result of saving
 * @param AC_Column         $column         Column object
 * @param int               $object_id      ID of item to be saved
 * @param mixed             $value          Value to be saved
 * @param ACP_Editing_Model $editable_model Editability storage model
 */
function my_acp_editing_save_value ( $result, $column, $object_id, $value, $editable_model ) {

	// 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, 5 );
add_filter( 'acp/editing/save/{$column_type}', 'my_acp_editing_save_value', 10, 5 );

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]