Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter RedfishTheCat

    (@redfishthecat)

    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

    Plugin Author Ronald Huereca

    (@ronalfy)

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Don't work with Author role’ is closed to new replies.