Please wait...

Actions

wpDataTables actionsActions defined in wpDataTables plugin for customizations

WordPress Actions are a convenient way to “hook” into different plugins without actually changing their code. Basically, “actions” are user-defined functions, assigned to certain labels, which are called by the plugin core at defined moments of its execution. Unlike filters, actions do not return any data, they are just executed.

You can read more about using WordPress actions and assigning your functions to actions in WordPress Codex, here we will provide a list of actions defined in wpDataTables plugin that you can use to customize it for your needs.

wpdatatables_before_get_table_metadata( $tableId )

This action is executed before the table metadata is fetched from the database (table settings, link to the file or the SQL query). You can use it to call some function that you need, or set some global variable.

wpdatatables_before_get_columns_metadata( $tableId )

This action is executed before the columns metadata is fetched from the database (column settings). You can use it to call some function that you need, or set some global variable.

wpdatatables_before_render_table( $tableId )

This action is executed before the table has starting to render (either by shortcode or without it).

wpdatatables_after_save_settings()

This action is executed after wpDataTables saves the settings data (after user presses “Save settings” in the backend settings page).

wpdatatables_after_save_table( $tableId )

This action is executed after wpDataTables saves the table data (after user presses “Save table” in the backend settings page).

wpdatatables_after_save_columns()

This action is executed after wpDataTables saves the column data (after user presses “Save table” in the backend settings page).

wpdatatables_settings_page()

This action is executed when the settings page is open in the back-end.

wpdatatables_addnew_page()

This action is executed when user opens the “Add new wpDataTable” in the back-end.

wpdatatables_browse_page()

This action is executed when user opens the browse page.

wpdatatables_try_generate_table( $type, $content )

This action is executed when a new table is first saved: wpDataTables tries to generate the table based on the provided data, and creates the columns and tables in the databased based on the results.

$type is the table type (xls, csv, mysql, json, xml, php).

$content is either a link to the data source file, or MySQL query.

wpdatatables_try_generate_table( $type, $content )

This action is executed when a new table is first saved: wpDataTables tries to generate the table based on the provided data, and creates the columns and tables in the databased based on the results.

$type is the table type (xls, csv, google_spreadsheet, mysql, json, xml, php).

$content is either a link to the data source file, or MySQL query.

wpdatatables_before_create_columns( $table, $tableId, $frontendColumns )

This action is executed before the column data is saved to the database (when the Save columns button is clicked in the admin panel).

$table is the wpDataTable object (class source/class.wpdatatable.php).

$tableId is the ID of the table description in MySQL.

$frontendColumns is the array of objects where every object is column from the front-end.

wpdatatables_after_insert_column( $columnConfig, $tableId )

This action is executed after the new column is inserted in the database (when the columns are first generated by the plugin).

$columnConfig is the array of column settings loaded from the database.

$tableId is the identifier of the table from MySQL.

wpdatatables_get_ajax_data( $tableId )

This action is executed before AJAX data is fetched for the server-side processing tables.

$tableId is the table identifier from the MySQL table.

wpdatatables_before_render_chart( $chartId )

This action is executed before chart starts to render.

$chartId is the table identifier from the MySQL table.

wpdatatables_after_frontent_edit_row( $formdata, $rowId, $tableId )

This action is executed after editing action was applied.

$formdata is the array of keys and values for editing.

$rowId is the ID field of the row in MySQL table that was edited.

$tableId is the table identifier from the MySQL plugin table (wp_wpdatatables).

wpdatatables_before_delete_row( $rowId, $tableId )

This action is called before a row is deleted from the frontend editor.

$rowId is the value of ID column.

$tableId is the table ID from wp_wpdatatables table.

wpdatatables_before_filtering_form( $tableId )

This action is called before the filtering form is rendered on the page.

$tableId is the table ID from wp_wpdatatables table.

wpdatatables_after_filtering_form( $tableId )

This action is called after the filtering form is rendered on the page.

$tableId is the table ID from wp_wpdatatables table.

wpdatatables_before_table( $tableId )

This action is called before the table itself is rendered on the page.

$tableId is the table ID from wp_wpdatatables table.

wpdatatables_after_table( $tableId )

This action is called after the table is rendered on the page.

$tableId is the table ID from wp_wpdatatables table.

wpdatatables_before_header( $tableId )

This action is called before the table header TR element is rendered on the page.

$tableId is the table ID from wp_wpdatatables table.

wpdatatables_after_header( $tableId )

This action is called after the table header TR element is rendered on the page.

$tableId is the table ID from wp_wpdatatables table.

wpdatatables_before_first_row( $tableId )

This action is called before first table row is rendered on the page.

$tableId is the table ID from wp_wpdatatables table.

wpdatatables_before_row( $tableId, $rowIndex )

This action is called before the table row is rendered on the page.

$tableId is the table ID from wp_wpdatatables table.

$rowIndex is a zero-based index of the row.

wpdatatables_after_row( $tableId, $rowIndex )

This action is called after the table row is rendered on the page.

$tableId is the table ID from wp_wpdatatables table.

$rowIndex is a zero-based index of the row.

wpdatatables_before_editor_dialog( $tableId )

This action is called before the table editor dialog (only for editable tables) is rendered on the page.

$tableId is the table ID from wp_wpdatatables table.

wpdatatables_after_editor_dialog( $tableId )

This action is called after the table editor dialog (only for editable tables) is rendered on the page.

$tableId is the table ID from wp_wpdatatables table.

wpdatatables_admin_before_edit()

Action you that is called before the table configuration section in admin part. You can use this action to include custom block and settings for the table

Never miss new features!

Join 2000+ newsletter subscribers

Never miss notifications about new cool features, promotions, giveaways or freebies - subscribe to our newsletter! We send about one mail per month, and do our best to keep our announcements interesting.

We never spam or disclose your address to anyone.