-
Hooks
-
-
- wpdatatables_before_get_table_metadata
- wpdatatables_before_render_table
- wpdatatables_before_render_table_config_data
- wpdatatables_after_save_table
- wpdatatables_try_generate_table
- wpdatatables_get_ajax_data
- wpdatatables_before_filtering_form
- wpdatatables_after_filtering_form
- wpdatatables_before_table
- wpdatatables_after_table
- wpdatatables_after_header
- wpdatatables_before_header
- wpdatatables_before_footer
- wpdatatables_after_last_row
- wpdatatables_before_row
- wpdatatables_after_row
- Show Remaining Articles (6) Collapse Articles
-
- wpdatatables_before_frontend_edit_row
- wpdatatables_after_frontent_edit_row
- wpdatatables_before_editor_dialog
- wpdatatables_after_editor_dialog
- wpdatatables_excel_before_frontend_edit_row
- wpdatatables_excel_after_frontent_edit_row
- wpdatatables_excel_after_frontent_edit_cells
- wpdatatables_before_delete_row
- wpdatatables_excel_before_delete_row
- wpdatatables_excel_after_delete_row
- wpdatatables_excel_after_delete_all_rows
- Show Remaining Articles (1) Collapse Articles
-
- wpdatatables_after_save_settings
- wpdatatables_settings_page
- wpdatatables_browse_page
- wpdatatables_support_page
- wpdatatables_welcome_page
- wpdatatables_system_info_page
- wpdatatables_getting_started_page
- wpdatatables_addons_page
- wpdatatables_constructor_page
- wpdatatables_dashboard_page
- wpdatatables_admin_before_edit
- wpdatatables_admin_before_edit_simple_table
- wpdatatables_enqueue_on_admin_pages
- wpdatatables_enqueue_on_edit_page
- wpdatatables_enqueue_chart_wizard_scripts
- wpdatatables_enqueue_on_settings_page
- wpdatatables_enqueue_on_dashboard_page
- wpdatatables_browse_charts_page
- wpdatatables_lite_vs_premium_page
- Show Remaining Articles (9) Collapse Articles
-
- Articles coming soon
-
-
-
- wpdatatables_filter_charts_table_page
- wpdatatables_filter_chart_wizard_page
- wpdatatables_filter_browse_charts
- wpdatatables_filter_int_cell_data_in_charts
- wpdatatables_filter_float_cell_data_in_charts
- wpdatatables_filter_apexcharts_render_data
- wpdatatables_filter_highcharts_render_data
- wpdatatables_filter_highstock_render_data
- wpdatatables_filter_chartjs_render_data
- wpdatatables_filter_google_charts_render_data
-
- wpdatatables_filter_table_metadata
- wpdatatables_filter_rendered_table
- wpdatatables_try_generate_table_result
- wpdatatables_filter_insert_table_array
- wpdatatables_filter_browse_tables
- wpdatatables_filter_mysql_query
- wpdatatables_filter_json
- wpdatatables_filter_excel_array
- wpdatatables_filter_table_description
- wpdatatables_filter_cell_val
- wpdatatables_filter_simplexml
- wpdatatables_filter_date_cell
- wpdatatables_filter_datetime_cell
- wpdatatables_filter_time_cell
- wpdatatables_filter_email_cell
- wpdatatables_filter_int_cell
- wpdatatables_filter_float_cell
- wpdatatables_filter_image_cell
- wpdatatables_filter_link_cell
- wpdatatables_filter_string_cell
- wpdatatables_before_generate_constructed_table_name
- wpdatatables_filter_table_title
- wpdatatables_filter_server_side_data
- wpdatatables_filter_table_cssClassArray
- wpdatatables_filter_query_before_limit
- wpdatatables_filter_initial_table_construct
- wpdatatables_before_create_manual_table
- wpdatatables_before_preview_file_table
- wpdatatables_before_read_file_data
- wpdatatables_query_before_save_frontend
- wpdatatables_before_generate_manual_table
- wpdatatables_add_default_columns
- wpdatatables_insert_additional_column_header
- wpdatatables_filter_column_metadata
- wpdatatables_filter_init_table_data
- wpdatatables_filter_nested_json_endpoint_args
- wpdatatables_get_one_level_deep_json_data_from_array_as_string
- wpdatatables_set_one_level_deep_json_data_separator
- wpdatatables_filter_nested_json_final_array
- wpdatatables_curl_get_data
- wpdatatables_curl_get_data_complete
- wpdatatables_filter_source_data_on_auto_update_cache
- wpdatatables_excel_filter_table_template
- wpdatatables_excel_filter_table_description
- wpdatatables_add_class_to_table_html_element
- wpdatatables_filter_pdo_connection_dsn
- wpdatatables_filter_mysqli_connection_link
- wpdatatables_before_generate_mysql_based_query
- wpdatatables_before_generate_wp_based_query
- wpdatatables_filter_interface_lang
- wpdatatables_filter_total_length_query
- wpdatatables_custom_prepare_output_data
- wpdatatables_filter_php_array
- wpdatatables_filter_google_sheet_array
- wpdatatables_filter_nested_json_array
- wpdatatables_filter_xml_array
- wpdatatables_filter_excel_based_data_url
- wpdatatables_filter_url_php_array
- wpdatatables_filter_serialized
- wpdatatables_filter_sql_disable_limit
- Show Remaining Articles (50) Collapse Articles
-
- wpdatatables_filter_columns_metadata
- wpdatatables_filter_column_before_save
- wpdatatables_filter_update_column_array
- wpdatatables_filter_insert_column_array
- wpdatatables_filter_column_cssClassArray
- wpdatatables_filter_column_js_definition
- wpdatatables_filter_column_options
- wpdatatables_columns_types_array
- wpdatatables_columns_not_in_source
- wpdatatables_filter_column_config_object
- wpdatatables_filter_column_description_object
- wpdatatables_insert_additional_column_value
- wpdatatables_filter_column_title
- wpdatatables_filter_filtering_default_value
- wpdatatables_filter_editing_default_value
- wpdatatables_column_formatter_file_name
- wpdatatables_extend_column_js_definition
- wpdatatables_cell_filter_column_key
- wpdatatables_cell_filter_column_id_value
- wpdatatables_cell_filter_column_id
- wpdatatables_filter_data_column_properties
- wpdatatables_extend_datacolumn_object
- wpdatatables_filter_supplementary_array_column_object
- wpdatatables_prepare_column_data
- wpdatatables_filter_columns_css
- Show Remaining Articles (15) Collapse Articles
-
- wpdatatables_filter_style_block
- wpdatatables_filter_frontend_formdata
- wpdatatables_allow_edit_table
- wpdatatables_filter_formdata_before_save
- wpdatatables_excel_filter_frontend_formdata
- wpdatatables_filter_excel_editor_query
- wpdatatables_excel_filter_delete_rows
- wpdatatables_filter_editing_default_value
-
- wpdatatables_get_system_fonts
- wpdatatables_before_save_settings
- wpdatatables_filter_constructor_page
- wpdatatables_filter_edit_page
- wpdatatables_filter_browse_page
- wpdatatables_filter_settings_page
- wpdatatables_filter_dashboard_page
- wpdatatables_filter_edit_page_simple_table
- wpdatatables_filter_support_page
- wpdatatables_filter_welcome_page
- wpdatatables_filter_system_info_page
- wpdatatables_filter_getting_started_page
- wpdatatables_filter_lite_vs_premium_page
- wpdatatables_filter_addons_page
- wpdatatables_filter_browse_tables_pagination_page_url
- Show Remaining Articles (5) Collapse Articles
-
- wpdatatables_filter_date_cell_before_formatting
- wpdatatables_filter_datetime_cell_before_formatting
- wpdatatables_filter_email_cell_before_formatting
- wpdatatables_filter_float_cell_before_formatting
- wpdatatables_filter_image_cell_before_formatting
- wpdatatables_filter_int_cell_before_formatting
- wpdatatables_filter_string_cell_before_formatting
- wpdatatables_filter_link_cell_before_formatting
- wpdatatables_filter_time_cell_before_formatting
- wpdatatable_cell_include_formatting
- wpdatatables_filter_cell_output
- wpdatatables_cell_value_filter
- wpdatatables_cell_filter_query
- wpdatatables_cell_data_rows_filter
- wpdatatables_cell_filtered_data_rows_filter
- wpdatatables_cell_output_filter
- wpdatatables_filter_formula_cell_before_formatting
- wpdatatables_filter_formula_cell
- wpdatatables_filter_hidden_cell_before_formatting
- wpdatatables_filter_hidden_cell
- wpdatatables_filter_column_params
- wpdatatables_filter_simple_table_cell_meta
- Show Remaining Articles (12) Collapse Articles
-
- Articles coming soon
-
-
-
Javascript
-
Extend wpDataTables
-
CSS
-
Database
-
PHP API (coming soon)
- Articles coming soon
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
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
add_filter( 'wpdatatables_add_class_to_table_html_element', 'add_class_to_table_html_element', 10, 2 );
add_filter( 'wpdatatables_add_class_to_table_html_element', 'add_class_to_table_html_element', 10, 2 );
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
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
// 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 );
// 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 );
// 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 );