Hi,
thanks for your question!
Yes, something like this is possible by using the regular Row Filter Extension from http://tablepress.org/extensions/row-filter/ together with the Extension from https://tablepress.org/extensions/shortcode-filter-get-parameter/
Regards,
Tobias
This works like a charm! One more question. How would I pass a “space” character through the URL. For example, in the regular search box one could type “mission accomplished” with the space in between. I tried using a “%20” in the URL, but it doesn’t work. Any thoughts?
Hi,
good to hear that this works! 🙂
To use a space character, please try a “+”, like
http://www.example.com/?table_filter=word1+word2
Regards,
Tobias
The plus sign didn’t do it :/ I also tried putting the 2 words with the + in quotation marks, thinking maybe they need to be contained or something. Any other ideas? If not, it’s not that big a deal. Thanks bro, your incredibly prompt with your support!
Hi,
weird… But before we investigate this in more detail, let’s clarify:
Do you want to search for the exact string “word1 word2” in a row, or do you want to search for “word1” or “word2” in a row, or do you want to search for “word1” and “word2” in a row?
Regards,
Tobias
Wow, you got me on that one. Didn’t think of those types of searching options.
My specific need is to search for the exact string “word1 word2” but I’d love to see how the other ways are possible also.
Hi,
yes, the Row Filtering Extension has some flexibilty. For the possible connectors, please see http://tablepress.org/extensions/row-filter/
Now, to make those work with the URL parameter Extension as well, a small change is necessary in the file “tablepress-shortcode-filter-get-parameter.php”. Please change line 17 from
$filter_term = preg_replace( '#[^a-z0-9]#i', '', $filter_term ); // only allow characters a-z, A-Z, and 0-9 in filter term
to
$filter_term = preg_replace( '#[^a-z0-9&| ]#i', '', $filter_term ); // only allow characters a-z, A-Z, and 0-9 in filter term
That will not only allow the || and && (which however has to be written URL-encoded as %26%26, but then also the space (for exact matching of “word1 word2”). You can then either use the or the encoded version %20.
Regards,
Tobias
Thanks Tobias. Made the change and everything works as expected. Awesome!
Hi,
very nice! 🙂 Good to hear that this worked. Thanks for the confirmation!
Best wishes,
Tobias