Custom view of form entries based on a form entry's field value

Greg Slonina
Sat, 14 Jan 2023 23:05:42 +0000
Get Help

For example:

There is a business with multiple franchises.

The website has a custom post type called Franchise and a user role called Franchisee.

A Franchisee miami_manager is assigned to Franchise miami.

Rather than creating multiple forms for different franchises the same form Estimate is used for all franchises.

A hidden field franchise_location is dynamically populated to that Estimate form based on the url it’s submitted from. This will help distinguish the different form entries.

I’ve programmed the above already but how would I do the rest of this.

Question:

When miami_manager logs into the dashboard he can only see form entries that contain the field franchise_location with a value of miami.

Possible way of doing this:

Using pre_get_posts and posts_where. Is this possible or is there a better way of doing this?

9 posts - 5 participants