wpdatatables_before_create_columns

Contents

Description

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

Usage

add_action( 'wpdatatables_before_create_columns', 'before_create_columns', 10, 3 );

Parameters

  • $type wpDataTable object
    wpDataTable object (class source/class.wpdatatable.php).
  • $tableId integer
    ID of the table description in MySQL.
  • $frontendColumns array
    Array of objects where every object is a column from the front-end.

Examples

// Callback function for the wpdatatables_before_create_columns action hook
function before_create_columns( $table, $tableId, $frontendColumns ) { 
   // Check for specific table id
   if ( $tableId == 1) { 
     // Your code
   } 
}

add_action( 'wpdatatables_before_create_columns', 'before_create_columns', 10, 3 );