I have been thinking about migrating WordPress Google Form from a shortcode based solution to a Custom Post Type solution. Today I decided to move from thinking about it to acting on it. As I add more features the short code complexity has grown quite a bit. Because the short code contains URLs with special characters, the chance of introducing a syntax error is very high and it is by far the most common support request I receive.
There are a lot of benefits to adding a custom Post Type, among them:
- Reduced syntax errors.
- Shorter short codes.
- No chance of misspelling attribute names.
- No chance of having duplicate (or triplicate!) attributes and wondering why the first value isn’t working.
- Possibility of having form specific CSS.
I plan to retain the current short code syntax so existing installations will continue to work but will introduce a new short code (likely [wpgform id=’N’]) which can be used in place of the current short code. Over time I will likely deprecate the older short code but not anytime soon.
The primary reason I am doing this is my desire to connect Google Forms with PayPal which I think I can do using a hook in Woo Commerce. Having the Google Form as a very simple short code will help me do what I want to do (I think).