wpdatatables_add_class_to_table_html_element

Contents

Description

This filter is used to add custom classes to the table’s HTML element before it is rendered.

Usage

add_filter( 'wpdatatables_add_class_to_table_html_element', 'add_class_to_table_html_element', 10, 2 );

Parameters

  • $classes string
    String of classes.
  • $tableId integer
    ID of table from database.

Examples

// Callback function for the wpdatatables_add_class_to_table_html_element hook
function add_class_to_table_html_element( $classes, $tableId ) {

if ( $tableId == 1) {
// Your code
}

}

add_action( 'wpdatatables_add_class_to_table_html_element', 'add_class_to_table_html_element', 10, 2 );