wpdatatables_add_default_columns

Contents

Description

This filter is applied to form an additional query statement for adding a default column, after the create statement for the table itself is formed, and after metadata is inserted into the database.

Usage

add_filter( 'wpdatatables_add_default_columns', 'add_default_columns', 10, 3 );

Parameters

  • $statement array
    An empty array which can be formed into a query statement using the filter to be added to the CREATE statement.
  • $tableId integer
    The table ID from the database.
  • $columnIndex integer
    The column index of the additional default column.

Examples

// Callback function for the wpdatatables_add_default_columns filter hook
function add_default_columns ( $statement, $tableId, $columnIndex ) { 
    // Your code
    // return an array with the statement and column index
    // $statement['statment'];
    // $statement['column_index'];
    return $statement;
}

add_filter( 'wpdatatables_add_default_columns', 'add_default_columns', 10, 3);