wpdatatables_filter_columns_metadata

Contents

Description

This filter is applied to the columns metadata returned from the DB (table settings, link to the data source file, or MySQL query).

Usage

add_filter( 'wpdatatables_filter_columns_metadata', 'filter_columns_metadata', 10, 2 );

Parameters

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

Examples

// Callback function for the wpdatatables_filter_columns_metadata filter hook
function filter_columns_metadata( $columnsMetadata, $tableId ) { 
   // Check for specific table Id
   if ( $tableId == 1) { 
     // Your code
   } 
}

add_action( 'wpdatatables_filter_columns_metadata', 'filter_columns_metadata', 10, 2);