wpdatatables_try_generate_table

Contents

Description

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 database based on the results.

Usage

add_action( 'wpdatatables_try_generate_table', 'try_generate_table', 10, 2 );

Parameters

  • $type string
    Table type (xls, CSV, MySQL, JSON, XML, PHP…).
  • $content string
    Content is either a link to the data source file or a MySQL query.

Examples

// Callback function for the wpdatatables_try_generate_table action hook
function try_generate_table( $type, $content ) { 
   // Check for specific table type
   if ( $type == 'xls') { 
     // Your code
   } 
}

add_action( 'wpdatatables_try_generate_table', 'try_generate_table', 10, 2 );