Best Way to get plugin shortcodes recognised by wp-forms

Hi,

I not sure of the best way to tackle this, I have tried dynamic, acf fields, and query strings but nothing worked. It does work using ACF on a page but not on a form, even if both are on the same page. I think this must mean that pages will run the scripts that lead to ACF default values being able to pick up the shortcode values returned by the script but forms don’t run the script.

I’d be grateful for any advice can anyone give on getting wp-forms to recognise these shortcodes and populate the form fields with the shortcode values returned by the plugin. I hope this makes sense.

Many thanks,

Hello @LFSdesign,

Thanks for writing in! Regretfully WPForms does not support shortcodes or the ACF data by default. You will have to create your own Smart Tags first before you can use the ACF fields. Perhaps this article:

Be advised that this is beyond the scope of our support. It is already considered as custom development. You may need to contact a 3rd-party developer or directly contact the creators of the WPForms and ACF plugins.

Thank you for your understanding.

Thank you for your reply.

I had already followed the instructions on that link and have pulled through the acf field in the drop down as shown. My problem is that they don’t show the full text on the shortcode example. The magnification cuts off part of the code. Do you know what that last line should say please?
?_action( 'generate_after_main_content

Thank you.

Hello @LFSdesign,

The last line is a code specific to the theme that he is using. You do not need that line in X or the Pro theme that you are currently using. You do not even need to do the last step. It will only apply if you are modifying the PHP templates. If you have added the ACF Smart Tags to your form, you can simply display the form by inserting the shortcode in the page content area or use the Form Integration element if you are building the page using Cornerstone Content Builder.

Best Regards.

Thank you.

I had tried that and I do have the acf fields showing up as selectable smart tags and the default value set to be picked up from acf field but unfortunately the value is not coming through. I think that the problem may be that there is a json that is called on the page that does populate the acf fields but the form itself does not see that json and the acf fields aren’t populated before the form opens on the page. If I could figure out a way to for the form to run or recognise the json when it opens the way a page does then I think I would not have a problem at all. On the page I have a text field just above the acf fields which just runs the json. I just don’t know how to add this json to the form itself. I hope that makes sense. I have a feeling this may be an easy solution just that I am still learning so it is not obvious to me.

Actually I’ve tried so many different ways I have gotten a little confused. Gravity forms does show the acf fields I’ve created but does not pull any data through. Wp-forms I did add the example code and revised the name to my field and then saved this in the child theme functions.php as suggested but it doesn’t come up in wp-forms for me to select under Smart Tags.

I’ve had another go and now the smart tag field does show as being selectable under smart tags for a single text item on the form. Unfortunately, it still does not pull any data through though. Interestingly enough, I only added the one test text field to functions.php and that field is the only one that is selectable on a text item, however all the fields I added in the acf group are selectable in confirmations and notifications, but again no data is being pulled through. Perhaps this is because I am not saving any of these acf fields on a page or post, but am only using them on a page just before the form for purposes of trying to get them onto the form itself.

Hello @LFSdesign,

As we have already mentioned in our previous reply, what you have in mind is beyond the scope of our support. Our support only covers getting your site set up, bug fixes, and minor cosmetic changes. Your issue is not a theme or plugin issue. It is already considered custom development since you want to add additional feature or integration of the mentioned p3rd party plugins. It is best that you contact a 3rd party developer or contact the lead developers of those plugins. You may even request to them if it is possible to add it as a feature request.

Thank you for your understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.