Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am using a plugin called Post Snippets.

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

http://wordpress.org/extend/plugins/post-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?

share|improve this question
add comment

1 Answer

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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