wpdatatables_filter_json

Contents

Description

This filter is applied to the JSON string before building a table based on it.

Usage

add_filter( 'wpdatatables_filter_json', 'filter_json', 10, 2 );

Parameters

  • $json string
    Json string.
  • $tableId integer
    ID of table from database.

Examples

// Callback function for the wpdatatables_filter_json filter hook
function filter_json( $json, $tableId ) { 
   // Check for specific table Id
   if ( $tableId == 1) { 
     // Your code
   } 
}

add_action( 'wpdatatables_filter_json', 'filter_json', 10, 2);