Filter with link – URL Variables using array_filter
-
Hi.
I was wondering if you would be so kind to give an example (similar to the from_date https://www.ads-software.com/support/topic/url-variables/#post-10684492) just using a GF field value. Creating a link to download only the rows where GF1 filed 33 value number = current post ID.Thank you.
<?php
// functions.php/**
* Filtering rows example ?workshop_id={workshop}
* Include row by default, but exclude based on a certain condition
* In this case we exclude every row where $workshop value does not equal current post ID
* And we take $workshop value from the GF 1 filed 33
*/add_filter(‘gfexcel_output_rows’, function ($rows) {
if (!array_key_exists(‘workshop_id’, $_GET)) {
return $rows; // nothing to filter
}$workshop_id =
??????????
return $rows; //include this row by default
});
});
- The topic ‘Filter with link – URL Variables using array_filter’ is closed to new replies.