在 TextArea 中允许 HTML [英] Allow HTML in TextArea

查看:36
本文介绍了在 TextArea 中允许 HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Wordpress 中构建自定义选项面板.我想提供的选项之一是能够将文本和 html 添加到页脚.我可以输入简单的标签,比如粗体——但是当你添加一个 URL 时,疯狂的事情就会发生.我做了一些谷歌搜索,发现了stripslashes",唉,这也不起作用.

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.

下面的代码是一个巨大的 case 语句的一部分.

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>

推荐答案

想通了.STRIPSLASHES 需要先!

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>

这篇关于在 TextArea 中允许 HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆