WordPress.org

Ready to get started?Download WordPress

Forums

Allow registered users edit their own comments (3 posts)

  1. fellowito
    Member
    Posted 2 years ago #

    I know this is a frequent question, but I haven't found a solution.

    I have WP 3.2.1. and I'd like to allow registered users to edit their own comments. I know the code php to show text if the author id is the same than the registered user who is seeing the web. The problem is, that registered users (level 0) aren't allow to edit comments. Where can I change that capability?

    I don't want to install another plugin, I want to do it by php code.

    If anyone wants to install a plugin, the most famous plugin is WP Ajax Edit Comments.

    Thanks you :)

  2. fellowito
    Member
    Posted 2 years ago #

    I've found that adding the next code to your functions.php (in your template directory), allow suscribers to edit comments, but every comment, not only their own comments.

    Code allow suscribers edit all comments:

    $role=get_role('subscriber');
    $role->add_cap('edit_comment');

    Unfortunately, I want they only can edit their own comments.

  3. Joshua Parker
    Member
    Posted 2 years ago #

    You should probably look at the code in one of those plugins to get an idea of what you should do. But IMHO, you should probably utilize a plugin because when you upgrade, you will wipe out your changes.

Topic Closed

This topic has been closed to new replies.

About this Topic