从你的评论来看,看起来你几乎做到了,
通常在内容下添加内容的插件use the_content
通过使用调用函数进行筛选add_filter
例如,outbarin插件这样调用它:
add_filter(\'the_content\', \'outbrain_display\');
因此,您可以通过传递priority参数对其进行排序
add_filter(\'the_content\', \'outbrain_display\',99);
但是直接在插件文件上更改它并不是正确的方法,因为下次更新插件时,您将丢失这些更改,因此正确的方法是使用
plugins_loaded
操作挂钩并移除他们添加的过滤器,然后使用所需的顺序重新添加此过滤器:
add_action(\'plugins_loaded\',\'my_content_filters_order\');
function my_content_filters_order(){
//first remove the filter call of the plugin
remove_filter(\'the_content\', \'outbrain_display\');
//... Do that for all filters you want to reorder
//... ex: remove_filter(\'the_content\', \'FB_like\');
//then add your own with priority parameter
add_filter(\'the_content\', \'outbrain_display\',99);
//... Do that for all filters just removed and set
//... the priority accordingly
//... Lower numbers correspond with earlier execution
//... ex: add_filter(\'the_content\', \'FB_like\',98);
//... this will run first then outbrain
}
希望这有帮助