Modify view filters using Php

By: Enrico Brugnoni | Asked: 06/07/2023
ForumsCategory: General questionsModify view filters using Php
Enrico Brugnoni asked 11 months ago

Is there a code capable of modifying the entry filters of a view?
Edit** Not trying to create a new filter with new logic, just adding one more filter of the already existing ones to the view via php
Example(Attachment)

Attachments
2 Answers
Walter JonesWalter Jones answered 11 months ago
What else are you trying to do?  The filters are pretty robust as they stand. 
Enrico Brugnoni replied 11 months ago

Yes, im not trying to create a new filter, i just need to add one more filter to the view via php code execution

Victor Font replied 11 months ago

Enrico, use the frm_view_order filter. You have access to the entire SQL query Formidable creates to return pertinent entry IDs. You can modify the filters, the SELECT statement, the LEFT JOINS, etc. I use this filter a lot to override Formidable's query to use my own queries to improve performance.

Enrico Brugnoni replied 11 months ago

Thanks!!!

Rob LeVineRob LeVine answered 11 months ago
Enrico Brugnoni replied 11 months ago

This is the hook description:
"This hook will only apply to filters you have added in the "Advanced Settings" section of your View"

However in the "Advanced Settings" section of your View i see no filters option, and the funztion code is not being executed, do you have any idea why this is the case?

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right