I am using a plugin called Post Snippets.

According to the documentation, it can substitute variables, such as {url} within the snippets.


I am unclear how to assign values from within a specific post to a variable.

I tried using exec-PHP, and used the following:

[exec]url = "domain.com";[/exec]

But the snippet registered no value for {url}.

How can I assign, from within a post, the value to a variable so that I can use it as described?


The Variables in Post Snippets (Wordpress Plugin) is a comma seperated value. When you use the snippet-insert button in the post/page editor, you can set those.

An example of this is given on the homepage of the plugin, there is even a screenshot demonstrating that. Please read the documentation first.

Those Post Snippet Variables are totally unrelated to PHP variables. I think that's just the thing you missed. You were looking in the wrong direction.

  • I am using shortcode...how do I pass the variables through a short code, I don't want to insert the actual html.... – Timothy Nov 20 '10 at 4:17
  • Hmm...that being said, can I change the url variables to be $vars so I can use php code? – Timothy Nov 20 '10 at 4:18
  • @timothy: as for the plugin, from a view from above, I think it's not possible out of the box. You might hack into the plugin, overload the shortcode and then pass some variable value (e.g. via a shortcode attribute) into the plugin. But I have not reviewed the plugins sourcecode if and how this is possible. If you enter the shortcode with some values, this might reveal how this is working. – hakre Nov 20 '10 at 4:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.