wpdatatables_filter_insert_column_array

Contents

Description

This filter is applied to the array which is inserted in the database (by $wpdb->insert()) when the columns are first generated and saved for a new table.

Usage

add_filter( 'wpdatatables_filter_insert_column_array', 'filter_insert_column_array', 10, 2 );

Parameters

  • $columnConfig array
    Array of values.
  • $tableId integer
    ID of table from database.

Examples

// Callback function for the wpdatatables_filter_insert_column_array filter hook
function filter_insert_column_array( $columnConfig, $tableId ) { 
   // Check for specific table Id
   if ( $tableId == 1) { 
     // Your code
   } 
}

add_action( 'wpdatatables_filter_insert_column_array', 'filter_insert_column_array', 10, 2);