wpdatatables_prepare_column_data

Contents

Description

The filter allows you to modify the column data array before it is returned and used to display the table.

Usage

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
add_filter( 'wpdatatables_prepare_column_data', 'customize_column_data', 10, 2 );
add_filter( 'wpdatatables_prepare_column_data', 'customize_column_data', 10, 2 );
add_filter( 'wpdatatables_prepare_column_data', 'customize_column_data', 10, 2 );

Parameters

  • $returnArray array
    The array containing column data, including order, titles, types, widths, formulas, filters, and other attributes for each column.
  • $column object
    The column object containing information about the current column being processed.

Examples

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
// Callback function for the wpdatatables_prepare_column_data filter
function customize_column_data($returnArray, $column) {
// Your code here
return $returnArray;
}
add_filter( 'wpdatatables_prepare_column_data', 'customize_column_data', 10, 2 );
// Callback function for the wpdatatables_prepare_column_data filter function customize_column_data($returnArray, $column) { // Your code here return $returnArray; } add_filter( 'wpdatatables_prepare_column_data', 'customize_column_data', 10, 2 );
// Callback function for the wpdatatables_prepare_column_data filter
function customize_column_data($returnArray, $column) {
    // Your code here

    return $returnArray;
}

add_filter( 'wpdatatables_prepare_column_data', 'customize_column_data', 10, 2 );