admin管理员组文章数量:1405154
I'm building a Wordpress theme and I use the Kirki Customizer framework to add controls and settings to the customiser. I added a description to some controls, using the following code:
'description' => esc_html__( 'Description here', 'kirki' ),
Now I want to add a link in the description to an external website. I already tried inserting HTML, but that doesn't work; it just did just output the flat HTML code. It probably has sth to do with the esc_html__() thing, but I already searched on the internet and couldn't find a solution for this. Please enlighten me if you have a solution! Thanks a lot ;)
I'm building a Wordpress theme and I use the Kirki Customizer framework to add controls and settings to the customiser. I added a description to some controls, using the following code:
'description' => esc_html__( 'Description here', 'kirki' ),
Now I want to add a link in the description to an external website. I already tried inserting HTML, but that doesn't work; it just did just output the flat HTML code. It probably has sth to do with the esc_html__() thing, but I already searched on the internet and couldn't find a solution for this. Please enlighten me if you have a solution! Thanks a lot ;)
Share Improve this question asked Dec 27, 2019 at 11:37 ralphjsmitralphjsmit 4026 silver badges23 bronze badges1 Answer
Reset to default 0esc_html__
is a translation API, specifically it's equivalent to this:
$var = esc_html( __( ... ) );
Note that __(
is not a language construct, it's a WordPress function.
Your problem is that esc_html
escapes your HTML so that its safe to render as text. Swap it for wp_kses_post
, and remove the __
function, you don't want html inside translation strings
A sidenote: Frameworks are useful, but they have disadvantages, in order to get help you now need to have the luck of coming across somebody else already familiar with the kirki customizer framework, which I've never heard of. General customizer knowledge is of little to no help, severely limiting your ability to research solutions and get the help of others.
In this case, your question was answerable without knowing anything about the customizer
本文标签: How to add a link to an external website in the description of a customizer control (with Kirki)
版权声明:本文标题:How to add a link to an external website in the description of a customizer control (with Kirki)? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744877472a2630002.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论