WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using an Options Panel to create my themes, and I would like to make the textareas from this OP to support my shortcodes too.

The code for that creates the textarea fields:

case 'textarea':
            $cols = '8';
            $ta_value = '';

            if(isset($value['options'])) {
                    $ta_options = $value['options'];
                    if(isset($ta_options['cols'])) {
                    $cols = $ta_options['cols'];

                $ta_value = stripslashes($data[$value['id']]);

                $output .= '<textarea class="of-input" name="'.$value['id'].'" id="'. $value['id'] .'" cols="'. $cols .'" rows="8">'.$ta_value.'</textarea>';

Any idea how can I do that?

Please let me know if I should provide more details. Thanks.

share|improve this question
simply use echo do_shortcode($textarea_value); – Bainternet May 28 '12 at 14:16
Yes, this works. I was looking more for a solution to wrap the textarea in do_shortcode() , so I don't add do_shortcode() to all my $textarea_value(s). But I will go with your solution. Thanks a lot. – Bogh May 28 '12 at 15:03
Bogh, can you post your corrected code here as an Answer? So this question doesn't remain unanswered... Thanks! – brasofilo May 28 '12 at 20:46
up vote 0 down vote accepted

simply use echo do_shortcode($textarea_value); (answer by @Bainternet)

share|improve this answer
Why not mark it as the answer? – Brian Fegter Aug 31 '12 at 13:34
Thanks for all your answers, and sorry for not accepting your answer. – Bogh Sep 3 '12 at 11:01

Your Answer


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.