Caldera Forms includes a entry viewer that can be displayed in 1 to 3 places:
- The main Caldera Forms admin page
- This option is always enabled
- A separate submenu page
- This option can be enabled in the form settings tab of each form
- This option is excellent for allowing users that do not have necessary privileges to edit forms to see form entries.
- In the front-end of your site using a shortcode or function (this option was added in Caldera Forms 1.5)
- This option is excellent when you do not want users to go to the WordPress to view your Caldera Forms form entries.
- You can use the same entry viewer as the admin, or the new entry viewer, which is better suited for front-end display.
Displaying Caldera Forms Entries In The WordPress Front-end
The same entry viewer that is shown in the Caldera Forms admin can also be shown in the front-end of you WordPress site. You have two options to insert the Caldera Forms entry viewer in WordPress content.
Currently in the Caldera Forms admin, the “classic” entry viewer is used. Both the classic and version 2 entry viewer can be used in the front-end, but the classic entry viewer is not a great fit for the front-end as it was designed for administration. It is recommend that you not use the classic entry viewer in the front-end. Doing so would require custom CSS to make it look good and modifications to permissions.
Displaying Caldera Forms Entries With A Shortcode
You can add a Caldera Forms entry viewer to post content using the caldera_forms_entry_viewer shortcode. This shortcode has one required argument id this is the ID of the form you wish to show. It also has three optional arguments:
- view_toolbar Show export/delete toolbar
- Default is false.
- You can use view_toolbar=”true” to show the actions toolbar, which allows exporting of data.
- Currently this option is only supported when using classic type, but will be supported for the new entry viewer soon.
- type Show classic or version 2 entry viewer
- Default is version 2
- Use “classic” or “1” to show version 1 entry viewer — IE the one currently shown in the admin.
- roles A comma separated list of roles that can view.
- Default is admin only
- Only supported for new entry viewer
Here is an example of how to show the Caldera Forms entry viewer, version 2, using a shortcode:
In this next example the classic entry viewer including the actions toolbar:
Displaying Caldera Forms Entries With PHP
If you would like to integrate the Caldera Forms entry viewer into a PHP file, such as a theme template file or page template file, you can do that using the Caldera_Forms_Entry_Viewer::form_entry_viewer_2() function. Simple paste this code where you would like to show the entry viewer and be sure to update the form ID for your form:
Or you can show the classic entry viewer, which is only recommended in the WordPress admin:
When building Caldera Forms, so it works for everyone, we have to assume that all saved entry data is private. You may wish to treat some or all entry data as public.
If the options described above to limit access by user role do not work for you, there is a filter that can help. It is documented here, with an example of how to show, to non-logged in users, all entries with the Caldera Forms front-end entry viewer or implement your own authorization system.
Make Your Own Entry Viewer
- We have a REST API
- We have a PHP query builder library
- We have a PHP API to create, modify and delete entries
- We have a PHP API to query entires, based on pagination
- We have a friend Matt who wrote an article about making his own entry viewer.