wpdatatables_column_formatter_file_name

Contents

Description

This filter is used to modify the file name of the formatter class for a specific column type. It provides the flexibility to customize or override the default formatter file path used for column generation.

Usage

add_filter( 'wpdatatables_column_formatter_file_name', 'custom_column_formatter_file', 10, 2 );

Parameters

  • $fileName string
    The default file name of the formatter class for the specified column type.
  • $columnType string
    The type of the column.

Examples

// Callback function for the wpdatatables_column_formatter_file_name filter hook
function custom_column_formatter_file($fileName, $columnType) {
    // Override formatter file for custom column type 'custom_type'
    if ($columnType === 'custom_type') { 
        return 'path/to/custom/formatter/class.custom_type.wpdatacolumn.php';
    }

    return $fileName;
}

add_filter( 'wpdatatables_column_formatter_file_name', 'custom_column_formatter_file', 10, 2 );