wpdatatables_filter_datetime_cell

Contents

Description

This filter is applied to the value of a datetime cell before it is returned to the front-end.

Usage

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

Parameters

  • $formattedValue datetime
    Datetime cell value.
  • $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_datetime_cell filter hook
function filter_datetime_cell( $formattedValue, $tableId ) {
// Check for specific table Id
if ( $tableId == 1) {
// Your code
}
}
add_action( 'wpdatatables_filter_datetime_cell', 'filter_datetime_cell', 10, 2);
// Callback function for the wpdatatables_filter_datetime_cell filter hook function filter_datetime_cell( $formattedValue, $tableId ) { // Check for specific table Id if ( $tableId == 1) { // Your code } } add_action( 'wpdatatables_filter_datetime_cell', 'filter_datetime_cell', 10, 2);
// Callback function for the wpdatatables_filter_datetime_cell filter hook
function filter_datetime_cell( $formattedValue, $tableId ) { 
   // Check for specific table Id
   if ( $tableId == 1) { 
     // Your code
   } 
}

add_action( 'wpdatatables_filter_datetime_cell', 'filter_datetime_cell', 10, 2);