Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

[development] hide comments at runtime via plugin

i need a way to hide certain comments in my plugin if they meet some criteria.
how would you make this happen?
like a hook before comment renders so that i can remove that comment from the loop.
is this achievable?


  • This sounds like something you could do at the template stage. In Smarty it would just require a test against some variable you set.
  • i need something more like:
    public function DiscussionController_BeforeDiscussionRender_Handler(&$Sender) { foreach($Sender->Data['Comments'] as &$cmt) { if(CRITERIA) unset($cmt); } }
  • codegruntcodegrunt New
    edited January 2011

    A quick find + grep + sort + uniq on my local install gives me these possible handlers:

    DiscussionController_AfterBuildPager_Handler($Sender) DiscussionController_AfterCommentBody_Handler(&$Sender) DiscussionController_BeforeBuildPager_Handler($Sender) DiscussionController_BeforeCommentDisplay_Handler($Sender) DiscussionController_BeforeCommentDisplay_Handler(&$Sender) DiscussionController_BeforeCommentsRender_Handler($Sender) DiscussionController_BeforeDiscussion_Handler($Sender) DiscussionController_BeforeDiscussionRender_Handler($Sender) DiscussionController_BeforeDiscussionRender_Handler(&$Sender) DiscussionController_CommentInfo_Handler(&$Sender) DiscussionController_CommentOptions_Handler($Sender)

    Examples of the call you want can be found in at least 3 modules:




Sign In or Register to comment.