Thank you Nick! I will give this a try ASAP.
I guess the php goes in my functions.php?
Thanks again
Yup.
Or you can make a plugin using Pluginception.
https://wordpress.org/plugins/pluginception/
Hi Nick,
I have actually just this implemented your code…it works great thanks!
There was just one problem that I had to fix though, the API name didn’t work for me.
I had to use a combination of numbers and letters associated with the custom field that you get when you generate a web-to-lead form under SalesForce – Setup – App Setup – Customise – Leads – Web-to-Lead e.g. ’00ND0000005e0pN’
Hope this makes sense!
Thanks again.
Hello,
I used Pluginception to create this plugin based on the code from https://gist.github.com/nciske/10047552. When I try to activate it, I get this error:
Fatal error: Cannot redeclare salesforce_w2l_field_embedurl() in /home/wp_5rdrm6/controlbionics.com/wp-content/plugins/salesforce-web-to-case-filter-for-urls/salesforce-web-to-case-filter-for-urls.php on line 26
Any suggestions as to what might be wrong? I’m a bit out of my depth here but would like to store the URL of the form in a custom field in Salesforce.
Thanks.
You need to rename the function with a prefix to match your site. The examples are just examples, they are not designed to be used verbatim. 😉
I’ll try to clarify that in the documentation.
So just replace salesforce_ with controlbionics_ in the function declaration and the filter callback (the second argument), but not the filter name (the first argument).
http://nacin.com/2010/05/11/in-wordpress-prefix-everything/
Also check to make sure you don’t have this defined elsewhere like functions.php – the error means your trying to declare this exact function name twice.
Thanks so much – that validated. One other question: when I add the custom field to my form, what should I enter in the Value field? %URL%?