theme options - How to support special characters in text field?

When i put special characters in text field on wordpress themes option then it's gonna add some slash characters Li

When i put special characters in text field on wordpress themes option then it's gonna add some slash characters Like if I put

It's  

then its show

It\'s. 

How i solve that?

When i put special characters in text field on wordpress themes option then it's gonna add some slash characters Like if I put

It's  

then its show

It\'s. 

How i solve that?

Share Improve this question edited Mar 14, 2013 at 20:31 fuxia 107k39 gold badges255 silver badges459 bronze badges asked Mar 14, 2013 at 20:01 Tawhidul IslamTawhidul Islam 1013 bronze badges 7
  • are you trying to add the characters to a word in a php file? – Androliyah Commented Mar 14, 2013 at 20:08
  • No, I'm trying on themes option panel. Maybe this option panel does not sanitize special characters. – Tawhidul Islam Commented Mar 14, 2013 at 20:18
  • Can you screenshot it? I cant picture your dillema. – Androliyah Commented Mar 14, 2013 at 20:20
  • How do you save the options? Add the code to your question. – fuxia Commented Mar 14, 2013 at 20:28
  • I'm using demo.truethemes/CodeCanyon-Pro-Panel/index.html – Tawhidul Islam Commented Mar 14, 2013 at 20:29
 |  Show 2 more comments

2 Answers 2

Reset to default 0

Wordpress always adds slash before quotes as the first step in processing input. You should strip those slashes before saving data into the DB. use stripslashes for strings or stripslashes_deep in case you are handling arrays.

You need to escape the apostrophe yourself. Two ways to escape apostrophes is to do this:

It"'"s

Or this:

It\'s

If you do not escape them yourself, you likely end up with the problem you're having now. So try one of these methods in your options panel text box and see if that answers your question.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744345035a4569630.html

相关推荐

  • theme options - How to support special characters in text field?

    When i put special characters in text field on wordpress themes option then it's gonna add some slash characters Li

    7天前
    60

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信