Hi Tobias,
Im trying to filter exact word, for example one of the words isnt actually a word is “ss” but when i filter it with the “ss” it shows all the data.
all the information is in the first column that need to be filter for example:
(filter 1)
ship | length | weight
SS Mildred | 200ft | 30ton (this would be displayed as it matches “SS”)
SS Morrison | 200ft | 30ton (this would be displayed as it matches “SS”)
S davidson | 250ft | 37ton (this would not be displayed as it dont match “SS”)
(filter 2)
ship | length | weight
SS | 200ft | 30ton (this would be displayed as it matches “SS”)
SS Mildred | 200ft | 30ton (not be displayed as it dont exact match “SS”)
SS Morrison | 200ft | 30ton (not be displayed as it dont exact match “SS”)
S davidson | 250ft | 37ton (not be displayed as it dont exact match “SS”)
Im currently using the title of the page to select the table id and the word to filter and have edited the page.php to store the following information.
<?php $wordlist = array("words", "to", "exclude","");
$string = strtolower(get_the_title()); //lower case and pull the title
foreach($wordlist as $word)
$string = preg_replace("/". $word ."/", " ", $string);
$string = preg_replace('/\s+/', '', $string);
$tabletitle = current(explode(' ', get_the_title()));
if (strtolower($tabletitle) == "word1") {
$tableid = "1";
} elseif (strtolower($tabletitle) == "word2") {
$tableid = "2";
} elseif (strtolower($tabletitle) == "word3") {
$tableid = "3";
}
?>
Currently using and works with everything except the “SS” (pulls all info on table) but works with “Mildred” as the filter term.
<?php tablepress_print_table( array( 'id' => $tableid, 'filter' => $string, ) ); ?>
Tried using:
<?php tablepress_print_table( array( 'id' => $tableid, 'filter' => $string, 'filter_full_cell_match' => 'true' ) ); ?>
With the above this the table shows no data on any filter term.
I would like to know how to filter exact text but allow contain of other words like example filter 1
and
I would like to know how to filter exact text like example filter 2
Thanks in Advance
P.S – I made a donation on the 17-6-2017 as I love the plugin and i have paid for other plugins with less user friendliness.