0

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

1
  • 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. :) Commented Apr 8, 2011 at 6:28

1 Answer 1

1

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.
2
  • 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... Commented Apr 6, 2011 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
    Commented Apr 6, 2011 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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