【问题标题】:Wordpress RSS Feed display raw shortcode (do not render)Wordpress RSS Feed 显示原始简码(不呈现)
【发布时间】:2016-08-25 08:06:48
【问题描述】:

我正在使用默认的 RSS 提要将一些内容传递到我管理的一些子网站。但是有一些短代码正在呈现,但应该由子站点呈现。

那么如何防止短代码被解析?

它的短代码来自一个插件。

[wb-rekentool "username/othername"]

【问题讨论】:

  • 能否包含代码示例?
  • 你不想渲染任何短代码?

标签: php wordpress feed


【解决方案1】:

我解决了这个问题!使用“the_content_feed”过滤器删除短代码:

function remove_sc_feed($content){
    remove_shortcode('wb-rekentool');
    return $content;
}
add_filter('the_content_feed', 'remove_sc_feed');

很简单,但找不到答案!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-12-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多