wpdatatables_filter_table_metadata

Contents

Description

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

Usage

add_filter( 'wpdatatables_filter_table_metadata', 'filter_table_metadata', 10, 2 );

Parameters

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

Examples

// Callback function for the wpdatatables_filter_table_metadata filter hook
function filter_table_metadata( $tableMetadata, $tableId ) { 
   // Check for specific table Id
   if ( $tableId == 1) { 
     // Your code
   } 
}

add_action( 'wpdatatables_filter_table_metadata', 'filter_table_metadata', 10, 2);