从Wordpress帖子中删除转义的引号

Dan*_*yle 0 wordpress quotes escaping wordpress-plugin double-quotes

在我的内容中,我<h3>为了直接链接而给出了我的标签id.

这是它在帖子编辑器中的样子:

<h3 id="h3-title">H3 Title</h3>
Run Code Online (Sandbox Code Playgroud)

这样我就可以像这样直接链接到它:

<a href="http://example.com/page#h3-title">H3 Title</a>
Run Code Online (Sandbox Code Playgroud)

但是,双引号会以某种方式转义,帖子页面上的html输出如下所示:

<h3 id="\"h3-title"\">H3 Title</h3>
Run Code Online (Sandbox Code Playgroud)

这使得链接不起作用:(

我已经尝试了很多东西,例如从the_content中删除wptexturize过滤器,确保magic_quotes关闭,甚至remove_filter('content_save_pre', 'wp_filter_post_kses');哪些东西都会破坏.

我正在认真考虑只是创建一个过滤器来删除斜杠,但似乎它们不应该被添加到开头.例如,它们不会添加到带有id的图像中,因此必须将它们添加到某处.这在视觉和html模式下都会发生.

任何帮助将不胜感激.

Woj*_*icz 5

关于SEO Smart链接插件.

它是由$text = stripslashes($text);以下声明引起的:

if ($options['excludeheading'] == "on") {
    //Here insert special characters
    $text = preg_replace('%(<h.*?>)(.*?)(</h.*?>)%sie', "'\\1'.removespecialchars('\\2').'\\3'", $text);
    $text = stripslashes($text);
}
Run Code Online (Sandbox Code Playgroud)