Create View automatically via code

By: Enrico Brugnoni | Asked: 06/12/2023
ForumsCategory: General questionsCreate View automatically via code
Enrico Brugnoni asked 1 year ago

Is it possible to create a view without going to the back-end and manually creating one? For example, using code.

Example (When a new user is registered, i create a new view for him with a custom entry filter)

*CLARIFICATIONS: I need each view to have a different entry filter as they should see entries from the same form.
Example. i need user5 when registered to see only the entry with id 71. The id is chosen by the user when registering

1 Answers
Victor Font answered 1 year ago
It's not possible to create a view on the fly. One view can be filtered using any parameter o display data the way you'd like. If user5 is only allowed to see a single entry, then you can either assign the user as the entry owner and use the user id to filter the view, or with a little more work, you can assign entry 71 to the user's WordPress user meta data and use that as filter for the view. View filters are the most powerful way to display entry data as you'd like.
Enrico Brugnoni replied 1 year ago

"you can assign entry 71 to the user's WordPress user meta data and use that as filter for the view"
How would that work? Could you give me a link or an example?

Victor Font replied 1 year ago

All the information you need can be found here: https://formidableforms.com/knowledgebase/user-registration/#kb-additional-customizations

Enrico Brugnoni replied 1 year ago

Thanks!

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