Hi, so I've got a form and view showing results on a page. There is a range of fields to filter results by and this works fine and shows the filtered results etc
I end up with a query string something like:-
domain.com/my-page?ca=Analytics&st=3
I'm using the hook 'frm_csv_where' to try and and match the filtered results on screen but I can only seem to get the 'created_at' field to work and do anything of note. What I would like to do is to somehow match the filters applied in the query string.
Start your code here
function customize_csv_export_where($where, $args) {
$category=isset( $_GET['ca'] )?sanitize_text_field( $_GET['ca'] ):'';
$status=isset( $_GET['st'] )?absint( $_GET['st'] ):0;
$where['created_at >'] = '2023-10-01 00:00:00';
return $where;
}
add_filter( 'frm_csv_where', 'customize_csv_export_where', 10, 2 );
As I say the code snippet above only works on the date field but would love to know how I can get it to pick up the field values set in the query string.
Thanks
In your code, you're not actually using $category or $status after setting them. You'll need to do something similar to this example on the frm_csv_where page to find entries that match the metadata you're filtering on.
Thanks for that Rob, I will check it out and attempt to understand it 🙂
Please login or Register to submit your answer