wpdatatables_filter_json

Contents

Description

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

Usage

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
add_filter( 'wpdatatables_filter_json', 'filter_json', 10, 2 );
add_filter( 'wpdatatables_filter_json', 'filter_json', 10, 2 );
add_filter( 'wpdatatables_filter_json', 'filter_json', 10, 2 );

Parameters

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

Examples

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
// 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);
// 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);
// 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);