It is also interested in such a feature.
Hi rakeshnirzari1 and antonms25,
Thank you for your interest in wpDataTables.
Unfortunately we do not have such feature for predefined global search value throw shortcode. Also column filters (that contain predefined filter values) are not available in Lite version.
What you can do is to use our PHP filter that you will insert in functions.php of your theme or child theme:
// $tableDescriptionObj is the PHP StdObj which contains all the necessary fields for initializing the table
// $tableId is the table identifier from the MySQL table (wp_wpdatatables)
// $wpDataTablesObj is wpDataTable object
function filterGlobalSearch( $tableDescriptionObj, $tableId , $wpDataTablesObj) {
if( $tableId == 1 ){
$tableDescriptionObj->dataTableParams->oSearch = array(
'bSmart' => false,
'bRegex' => false,
'sSearch' => 'Your search data'
);
}
return $tableDescriptionObj;
}
add_filter('wpdatatables_filter_table_description','filterGlobalSearch', 10, 3);
Of course you will replace variable $tableId with table id that you need and also you will insert your search criteria (instead of string ‘Your search data’)
Best regards.
-
This reply was modified 2 years, 11 months ago by wpDataTables.
-
This reply was modified 2 years, 11 months ago by wpDataTables.