Allow HTML in TextArea

2019-08-17 13:41发布

I'm building a custom options panel in Wordpress. One of the options I'd like to offer is the ability to add text and html to the footer. I can enter simple tags like, bold - but when you add a URL crazy stuff happens. I did some googling and found "stripslashes", alas that doesn't work either.

The code below is part of a giant case statement.

   <textarea cols="70" rows="5" name="<?php echo $value['id']; ?>" class="ainput" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" />
      <?php echo get_settings (stripslashes($value['id'])); ?>
   </textarea>

1条回答
叛逆
2楼-- · 2019-08-17 14:01

Figured it out. STRIPSLASHES needs to first!

<textarea cols="70" rows="5" name="<?php echo $value['id']; ?>" class="ainput" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" />
          <?php echo stripslashes(get_settings($value['id'])); ?>
</textarea>
查看更多
登录 后发表回答