0
我想发布短代码的自定义帖子类型有功能添加新闻,但它只是继续显示短代码本身,而不是短代码内容。WordPress的短代码在自定义帖子类型
在我的主题的functions.php的我已经加入:
add_filter('insertPages_init', 'shortcode_unautop');
add_filter('insertPages_init', 'do_shortcode');
,并在我的insertpages插件的功能如下:
function insertPages_init() {
add_shortcode('insert', array($this, 'insertPages_handleShortcode_insert'));
}
从自定义类型后制作后仍然只是打印短代码而不是其内容。我可以得到它的工作,因为我希望使用示例:
add_filter('widget_text', 'do_shortcode');
而且工作得很好。
如何让我的自定义帖子类型接受简码?
尝试调用'init'钩子上的'insertPages_init'。 – SidFerreira 2015-04-01 09:15:24
https://wordpress.org/support/topic/enable-shortcodes-in-custom-post-types – bodi0 2015-04-01 09:16:49
嗨,对不起,即时通讯新的,我将如何去呢?谢谢 – darrrrUC 2015-04-01 09:17:09