WordPress.org

Ready to get started?Download WordPress

Forums

Filter display of comments based on content of comment (2 posts)

  1. harknell
    Member
    Posted 6 years ago #

    Hi, I'm wondering if there is a way of parsing the content of a comment and then choosing to display that comment or skip it based on a conditional of what's in the comment. This needs to be done from a plugin, not using any theme editing or additions. So what I want to do is filter the contents of comments to any page/post during the display comments loop, get each id and page it's posted on and it's content, if that content then matches something I conditionally set, then skip displaying that comment to the user and move on to the next comment in the loop.

    It's doing this from a plugin and not using theme commands that's making it harder for me to figure this out.

    Anyone help?

  2. Kafkaesqui

    Posted 6 years ago #

    Hmm. Never looked at this before but one specific filter seems to make a plugin for it pretty easy. Here's a quickie plugin 'framework' to work with:

    http://wordpress.pastebin.ca/896826

Topic Closed

This topic has been closed to new replies.

About this Topic