[Resolved] How use a shortcode instead of options for CRED forms?
This thread is resolved. Here is a description of the problem and solution.
Problem:
How to display clean text raw output with views.
Solution:
Since Views 1.11 we have had to wrap Views loop outputs in default HTML and CSS/JS in order to support things like infinite scrolling, and future to come features like "Front End Sorting and Ordering".
To return a "clean" Loop output is using the filter 'wpv_filter_wpv_view_shortcode_output' to your current theme's functions.php file.
I want to create a CRED form with the use of Field type "Select". I want to use Views shortcode to dynamically populate the options in this field. Here is a description of this function:
"When options for a generic field need to be generated dynamically, a shortcode can be used to generate the field options on the fly. Using a View shortcode to generate options based on criteria is a usual case. Any shortcode which will generate a valid JSON format of options can be used."
I created a view, which generates the appropriate values:
{"value":"12","label":"POST Test 3"},
{"value":"10","label":"POST Test 2"},
{"value":"8","label":"POST Test 1"},
{"value":"demo","label":"demo"} ]
However, if I insert shortcode as an option, the generic field is not displayed in the form. You can help with the configuration form? I will provide data access to the demo site.
I need to check on your install why its not working. It should work.
1)
Could you please share problem URL.
2)
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).
I have set the next reply to private which means only you and I have access to it.
I checked and view's output is wrapped with additional required divs. To have raw text output just like json as I suggested you should add following code to your current theme's functions.php file.