Forums

Prevent Non-Admin Role From Editing/Deleting Comments (3 posts)

  1. asechrest
    Member
    Posted 9 months ago #

    For those who have experimented with Wordpress CMS functionality (especially those using Role Manager, et al), has anyone found a way to allow a general user to publish AND edit a published post, but NOT edit or delete other peoples' comments from that post?

    I've tried this every which way, but it appears that the two go hand-in-hand. If I want to give users the ability to edit published posts, they automatically get the ability to edit/delete comments within their post - even if that comment is from a role "higher" than them, or from blog admin!

    Anyone found a way around this? It's important for the current vision of my blog that users be able to edit and update their posts by not edit or delete others' comments from that post at will. (FYI, no coding experience, but willing to dig through the .php files and try to figure it out.)

    Thanks in advance.

  2. asechrest
    Member
    Posted 9 months ago #

    Update: I've experimented with a bunch of combinations of plugins and restrictions within those plugins. I just can't seem to get it done.

    At this point I'd settle for something that simply masks a user's ability to edit/delete comments in their post while still retaining the ability to publish and edit their original post.

    If no one knows of a plugin that could do this, are there some code adjustments that could be made?

    Thanks.

  3. acub
    Member
    Posted 2 months ago #

    if you're still interested, I made something similar today. but i've done it by modifying theme files, as my theme was overriding WordPress original comments.
    you need to find in your theme the place where your link gets placed in the comment and wrap it between 2 lines of code:
    this one goes before:
    <?php if (current_user_can('moderate_comments')) : ?>

    and this one goes after:
    <?php endif;?>

    however, this is only a hack. it prevents the display of the link to comment editing page.
    if a user is smart enough to duplicate the exact address of that page (with action name and comment number) he might be able to modify the comment. not very likely, but possible.

Reply

You must log in to post.

About this Topic