artstorm/post-snippets — pull request #2 by om4james (2013-02-19 22:31:02+00:00)
Title: Bugfix: Default values for shortcode variables now work correctly

Fixes http://wordpress.org/support/topic/plugin-post-snippets-problem-with-defaults.

To test this, use:

Snippet name (shortcode):
fbcomments

variables: url=
http://www.xyz.com

snippet:

Then add the following to a post or page:

[fbcomments]
[fbcomments url="http://www.abc.com"]

The resulting HTML output now correctly uses the default "http://www.xyz.com" URL in the first example (because the url="" parameter isn't specified in the short code).

The second example instead uses the "http://www.abc.com" URL (because the short code overrides the snippet's default value).

We should probably also update the "Insert Snippet" Javascript code to not actually insert the default value into a post/page.