Lookup menu

By: Thando Baca | Asked: 11/23/2022
Thando Baca asked 2 years ago
I have a lookup menu that is filtered by another lookup menu. E.g. on the portal companies can create jobs and applicants can apply for jobs. So the first lookup filters down the industry (i.e. technology or medical) and the second lookup filter needs to filter down the jobs (i.e. senior developer or graphic designer positions). The problem that I have is: I cannot filter the second lookup based on the job closing date of the job- as we do not want applicants to apply for the position through the portal if the job has been closed. Accordingly, can you assist with this?
1 Answers
Victor Font answered 2 years ago
There are two hooks you can use here: frm_setup_new_fields_vars and frm_setup_edit_fields_vars. You can redefine your drop down and filter the results with SQL.
Thando Baca replied 2 years ago

And how do I filter results with SQL

Victor Font replied 2 years ago

You write a SQL SELECT statement, use the the wpdb object to execute it and apply the results to your dropdown. The SQL SELECT should only pull the values you want. There are plenty of examples to learn from in the knowledge base articles for the two hooks.

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