This documentation is deprecated since Admin Columns version 4.
Please view the updated version of this documentation here.

The filter cac/editable/column_value is used to change and retrieve the editable value.

Usage

There are 2 ways to hook into cac/editable/column_value.

  • cac/editable/column_value – filter for every column
  • cac/editable/column_value/column=[column name] – filter for a specific column
/**
 * Filtering: change raw value, used for editability, for a column
 *
 * Filter cac/editable/column_value
 * Filter cac/editable/column_value/column=[column name]
 *
 * @param mixed $value Column value used for editability
 * @param CPAC_Column $column Colum object
 * @param int $id Post ID to get the column editability for
 * @param CACIE_Editable_Model $editable_model Editability storage model
 */
function my_cac_get_editable_column_value( $value, $column, $id, $editable_model ) {
	// Possibly modify $value
	return $value;
}
add_filter( 'cac/editable/column_value', 'my_cac_get_editable_column_value', 10, 4 );
add_filter( 'cac/editable/column_value/column=[column name]', 'my_cac_get_editable_column_value', 10, 4 );

Example

In this example we get the value for the Title SEO column ( WordPress SEO by Yoast )

// Get the value for Title SEO column ( WordPress SEO by Yoast )

function my_cac_get_editable_column_value_seo_title( $value, $column, $id, $model ) {
	return get_post_meta( $id, '_yoast_wpseo_title', true );
}
add_filter( 'cac/editable/column_value/column=wpseo-title', 'my_cac_get_editable_column_value_seo_title', 10, 4 );

Tutorial

You can make your own created column editable in just minutes with our tutorial on how to make a column editable.