This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This filter allows modifying the value of a column in the Entries list table.
Usage
add_filter( 'frm_entries_column_value', 'wrap_column_value_in_span' );
Parameters
- $val (mixed): Column value. This type should be printable.
- $args (array): Contains item (the entry object) and col_name.
- col_name can be the field key or specific strings. Check FrmEntriesListHelper::column_value() for more details
Examples
Wrap the value of checkbox field in a span
add_filter( 'frm_entries_column_value', 'wrap_column_value_in_span' );
function wrap_column_value_in_span( $val, $args ) {
$field = FrmField::getOne( $args['col_name'] );
if ( ! $field ) {
return $val; // Field does not exist or this is a specific column.
}
if ( 'checkbox' === $field->type ) {
$val = '<span>' . $val . '</span>';
}
return $val;
}