cac/editable/options

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

The filter cac/editable/options allows you to change the editable options for any stored column.

Usage

/**
 * Filters the options for the editable field.
 *
 * @since 3.2.2
 * @param array $editable List of edit options ([type] => [field_type] )
 * @param array $column Stored column settings
 */
function my_cac_editable_options( $editable, $column ) {

	// Possibly modify $editable

	return $editable;
}
add_filter( 'cac/editable/options', 'my_cac_editable_options', 10, 2 );

Example

Change the Custom Field type “Date” to a datepicker.

/**
 * Inline Edit: change custom field type "date" from a text field to a datepicker
 *
 */
function my_set_editablie_custom_field_to_datepicker( $editable, $column ) {
	if ( 'column-meta' == $column['type'] && 'date' == $column['field_type'] ) {
		$editable['type'] = 'date';
	}

	return $editable;
}
add_filter( 'cac/editable/options', 'my_set_editablie_custom_field_to_datepicker', 10, 2 );