On a job site, I have a view where all job offers are listed. Each job offered has a ref ID which is the post ID (circled in yellow on the attached image)
People can filter this list by job category, also can filter by typing the title of the job offer.
I would need people to find a job offer also filtering by Ref ID (= post ID)
E.g.: they type 3545 and hit search and they find the job offer which has 3545 as post ID in the search results.
Front end filtering is only supported for custom fields and taxonomies, not for standard post fields such as ID.
However, it is possible to include a Query Filter for the post ID that will listen for a URL parameter, so insert that, and note that it will suggest by default a URL parameter of post_ids.
Now we need to add front end controls where your users can input an ID to search by.
You can use the wpv-control shortcode to effectively fake a front-end filter, that is, it will include the control and pass the search input as a URL parameter.
So manually add the following to your Search and Pagination editor together with your other controls (you'll want to add a label to the field, etc.):
But I understand I should set permalinks to %post_id% (instead of post name) for this to work... which means all my pages permalink would also change ? If it is the case this would be problematic in terms of SEO.
Here is my new filter which includes your proposed code, but unfortunately the filter does not work, I may have missed something... Here is the page hidden link
When I input a reference, say 3565, the filter does not select this unique job offer