WordPress.org

Ready to get started?Download WordPress

Forums

Simple Comment Editing
[resolved] Don't work with Author role (3 posts)

  1. RedfishTheCat
    Member
    Posted 10 months ago #

    Hi,

    Don't work on Author role.
    Only on Subcriber and Contributor.
    :-/

  2. RedfishTheCat
    Member
    Posted 10 months ago #

    Find from where come the problem:

    In the index php, we can find that:
    if ( current_user_can( 'moderate_comments' ) ) return; //They can edit comments anyway, don't do anything
    if ( current_user_can( 'edit_post', $post_id ) ) return; //Post author - User can edit comments for the post anyway

    So, Author role can edit post (only own in fact), but it cannot moderate comments mostly (he can only do it for is own posts, with all comments in that post, but not to others posts).

    In wordpress logic, author:
    -Have edit_post capability.
    -Don't have moderate_comments capability.

    So, Simple Comment Editing so as Author can manage comments, and don't modify is capability.
    And wordpress don't guive Author capability do modify post.
    So, it's dont work.

    I delete this line:
    if ( current_user_can( 'edit_post' ) ) return; //They can edit comments anyway, don't do anything
    And now it work.
    On others posts, Author can now modify is own comment (only) with the plugin.
    And on in own posts, Author can modify (as before) all comments with plugin for is comments, with wordpress function for the others comments on this post.

    Can you modify you plugin ?
    Or next time we make upgrade of your plugin, will loose this edit.

    Thank !

    With regards
    Redfish

  3. Ronald Huereca
    Member
    Plugin Author

    Posted 9 months ago #

    I uncommented the 2 lines for 1.2.0. I'll leave it there for now unless there are a lot of complaints.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.