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 need to write a dynamic shortcode. The original says: [... width="940" height="200" ...]

I need to have this: [... width="<php>" height="<php>" ...]

How do I get this to happen??

Thanks, Floyd

share|improve this question
    
Now there’s the problem. I tried to do something, that isn’t possible at all. Thanks for your answer though... I wish I had a better start in this forum. :) –  Sgt Floyd Pepper Apr 8 '11 at 6:28
add comment

1 Answer

Shortcodes are plain text wrapper made exactly for cases when PHP code is not available or should not be used.

  1. You can concatenate that to string and evaluate it with do_shortcode().
  2. You can look up function that powers shortcode (set up with add_shortcode()) and use it in PHP code directly.
share|improve this answer
    
Sorry, my fault. I made a mistake in the question. I have this: <?php echo do_shortcode('[... width="940" height="200" ...); ?>and I want to have this: <?php echo do_shortcode('[... width="<javascript>" height="<javascript>" ...); ?> I know it is strange, but probably someone will get me... –  Sgt Floyd Pepper Apr 6 '11 at 10:58
2  
@Sgt. Floyd Pepper please edit your question with those details... And now I am even more confused about what you are trying to do. :) –  Rarst Apr 6 '11 at 11:05
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.