wpdatatable_cell_include_formatting

Contents

Description

This filter is used to modify how a single cell shortcode’s data is prepared and whether formatting is included in the output or not.

Usage

add_filter( 'wpdatatable_cell_include_formatting', 'disable_cell_formatting', 10, 3 );

Parameters

  • true boolean
    The default value, meaning that formatting is applied unless the filter changes it.
  • $columnKey string
    Column name.
  • $rowID integer
    ID of the cell row.
  • $tableId integer
    ID of table from database.

Examples

// Callback function for the wpdatatable_cell_include_formatting filter hook
function disable_cell_formatting ($includeFormatting, $columnKey, $rowID, $tableID) {
    if ($tableID === 1) { // Replace 1 with your table ID
        return false; // Skip formatting for this table
    }
    return $includeFormatting; // Default behavior for other tables
}, 10, 3);

add_filter( 'wpdatatable_cell_include_formatting', 'disable_cell_formatting', 10, 3);