admin管理员组文章数量:1130349
Is there a way to enable shortcodes in text saved in the customizer and retrieved using get_theme_mod?
I'm guessing there's a filter in a similar manner to enabling shortcodes in widgets.
Is there a way to enable shortcodes in text saved in the customizer and retrieved using get_theme_mod?
I'm guessing there's a filter in a similar manner to enabling shortcodes in widgets.
Share Improve this question asked Apr 27, 2016 at 14:44 mistertaylormistertaylor 6411 gold badge6 silver badges20 bronze badges1 Answer
Reset to default 4To enable shortcodes in text widgets add a filter like that:
add_filter( 'widget_text', 'do_shortcode' );
You can pass every string to do_shortcode() including get_theme_mod() calls.
echo do_shortcode( get_theme_mod( 'theme_setting' ) );
Is there a way to enable shortcodes in text saved in the customizer and retrieved using get_theme_mod?
I'm guessing there's a filter in a similar manner to enabling shortcodes in widgets.
Is there a way to enable shortcodes in text saved in the customizer and retrieved using get_theme_mod?
I'm guessing there's a filter in a similar manner to enabling shortcodes in widgets.
Share Improve this question asked Apr 27, 2016 at 14:44 mistertaylormistertaylor 6411 gold badge6 silver badges20 bronze badges1 Answer
Reset to default 4To enable shortcodes in text widgets add a filter like that:
add_filter( 'widget_text', 'do_shortcode' );
You can pass every string to do_shortcode() including get_theme_mod() calls.
echo do_shortcode( get_theme_mod( 'theme_setting' ) );
本文标签: theme customizerHow to enable shortcodes in text retrieved from getthememod
版权声明:本文标题:theme customizer - How to enable shortcodes in text retrieved from get_theme_mod 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749249982a2339536.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论