admin管理员组文章数量:1405618
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
2 Answers
Reset to default 0Wordpress 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.
本文标签: theme optionsHow to support special characters in text field
版权声明:本文标题:theme options - How to support special characters in text field? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744345034a2601705.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论