Here are some quick tips and guidelines on working with shortcodes, useful not only for the Connections shortcodes but for all plugins that use them.

- Always add and edit shortcodes using the Text tab and not the Visual tab in the WordPress Editor. This will help ensure that fancy quotes are not used, and no HTML is pasted from a web page. WordPress does not support fancy quotes and, in most cases, prevents a shortcode from functioning correctly.
- NOTE: In the new WordPress Block Editor, use the Shortcode block.
- It is always best to manually type them out and not copy-paste them from a web page.
Important
Multiple short attributes are added to the same shortcode. Do not add the shortcode to the page multiple times with different attributes.
Never copy shortcodes or their option value pairs from a web page and paste them into the WordPress Visual Editor. In all likelihood, you will be pasting in fancy quotes that break the ability of WordPress to properly read the shortcode. The underlying HTML of the source page will also be pasted into your page. This means you will see a shortcode that looks right but is actually not a shortcode at all and can not be properly read by WordPress.
- Quotes are optional for single value options such as an ID number, true or false. When an option can take multiple words as values, quotes are necessary. This way, WP knows that they are one value for a single option vs. multiple options.
- DO:
[shortcode-tag option=1]
- DO:
[shortcode-tag option=true]
- DO:
[shortcode-tag option='true']
- DO:
[shortcode-tag option='one value for an option']
- DO NOT:
[shortcode-tag option=one value for an option]
. WordPress will read this as value one for option; the remaining words will be processed as options with no value. Also, a properly coded shortcode will discard those as invalid options.
- DO:
- Not a rule, but recommended… Always quote the option values even though, in some cases, they are not required to be quoted.
- DO:
[shortcode-tag option='true']
even though[shortcode-tag option=true]
is valid.
- DO:
- Not so much a rule, but a suggestion… Stick to a single quote type for your option values. Meaning, stick with a single quote style. Meaning, use either only single quotes ‘ or double quotes “.
- DO:
[shortcode-tag option='value']
- DO:
[shortcode-tag option="value"]
- DO NOT:
[shortcode-tag option='value"]
. Notice the different quotes being used.
- DO:
- When using a single quote (an apostrophe) within an option value, you must use double quotes:
- DO:
[shortcode-tag option="value's"]
- DO NOT:
[shortcode-tag option='value's']
. If you have a shortcode with multiple option-value pairs, this can break the ability of WordPress to match the proper options and values, leading to anything from broken shortcode to unpredictable results.
- DO:
- Do not use fancy quotes; always use straight quotes when quoting the option values. This is a fancy single quote, ‘ and this is a fancy double quote “. Outside of shortcodes, WordPress will convert the straight quotes to be fancy quotes. To use straight quotes, you do not need to do anything special; just use the quotes on the keyboard as you normally would.
Following the above guidelines and suggestions will help prevent the many issues when working with shortcodes.