wpdatatables_custom_prepare_output_data

Contents

Description

This filter allows you to modify the prepared output data before it is returned in the AJAX response for a wpDataTable.

Usage

add_filter( 'wpdatatables_custom_prepare_output_data', 'customize_output_data', 10, 5 );

Parameters

  • $data array
    The base array containing the total number of records, the total number of filtered records, and data rows prepared for the table output. Each row represents a record in the table.
  • $table object
    The WPDataTable object representing the table being processed. Provides access to methods and properties of the table.
  • $mainResDataRows array
    The raw data rows fetched from the database before processing.
  • $wdtParameters array
    The parameters and settings for the table, including column definitions and user configurations.
  • $colObjs object
    An object of column objects that define the properties and behavior of each column in the table.

Examples

// Callback function for the wpdatatables_custom_prepare_output_data filter hook
function customize_output_data($data, $table, $mainResDataRows, $wdtParameters, $colObjs) {
    // Your code here

    return $data;
}

add_filter( 'wpdatatables_custom_prepare_output_data', 'customize_output_data', 10, 5 );