Php 有条件的;“U内容”;压滤机

Php 有条件的;“U内容”;压滤机,php,wordpress,wordpress-theming,Php,Wordpress,Wordpress Theming,我在functions.php中为“the_content”添加了一个过滤器 add_filter ('the_content', 'testFilter'); function testFilter($content) { if(is_single()) { $content.="Append content"; } return $content; } 现在在我的content-post.php中。我有以下几行: the_content(__('Test;', 'ta

我在functions.php中为“the_content”添加了一个过滤器

add_filter ('the_content', 'testFilter');
function testFilter($content) {
  if(is_single()) {
    $content.="Append content";
  }
  return $content;
} 
现在在我的content-post.php中。我有以下几行:

the_content(__('Test;', 'tag') );

如何排除在content-post.php页面上应用testFilter?

在函数
上方添加
删除\u filter
函数(\uuu('Test;','tag'))


在函数上方添加
remove_filter
函数
函数内容(uu('Test;','tag'))


我看到您已将第三个参数设置为11,它是优先级。。。11有什么具体原因吗?这是为了优先考虑。默认设置为10。所以我给11加上优先权。谢谢。。我只想添加这个作为参考,
add\u action
remove\u action
的第三个参数是优先级,正如您已经确定的那样。但是,需要注意的是,您不能删除优先级与添加时不同的筛选器。我看到您已将第三个参数设置为11,它将优先级设置为11。。。11有什么具体原因吗?这是为了优先考虑。默认设置为10。所以我给11加上优先权。谢谢。。我只想添加这个作为参考,
add\u action
remove\u action
的第三个参数是优先级,正如您已经确定的那样。但是,需要注意的是,您不能删除优先级与添加时不同的筛选器。
remove_filter( 'the_content', 'testFilter',11 );
the_content(__('Test;', 'tag') );