有核心的WordPress文件的功能get_comment_reply_link。它有一个如下的“apply_filters”语句:apply_filter没有得到执行的机会
return apply_filters('comment_reply_link',$ before。$ link。$ after,$ args,$ comment,$ post);
不幸的是,该函数中的一些检查使得它在某些情况下返回而没有达到“apply_filters”语句,所以我的自定义函数从不运行!如果我手动将“apply_filters”行移动到顶端,那么它工作正常。
这是预期的行为?如果apply_filters从来没有机会被调用,我该如何运行自己的函数?由于我不想更改必要的WordPress核心,我可以向WordPress团队提交请求以进行此更改吗?
在您的主题中如何调用get_comment_reply_link? – brasofilo
它通过comment_reply_link从comment-template.php中调用。 http://core.trac.wordpress.org/browser/tags/3.6.1/wp-includes/comment-template.php#L0 –