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.

  • 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

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

  • Why not mark it as the answer? – Brian Fegter Aug 31 '12 at 13:34

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.