Skip to:
Content
Pages
Categories
Search
Top
Bottom

Delete own posts


  • LeGuerg
    Participant

    @isa_admin

    Hello,

    I get an issue with the bbPress capabilities. My forum Participants are set with edit_replies, delete_replies, edit_topics, delete_topics capabilities, but they can not delete their own posts because the links are not displayed. Keymasters and Moderators have no problem since they are moderators on the whole forum.

    So I checked the code in ./includes/topics/capabilities.php and includes/replies/capabilities.php and added the code below to fix the issue:

    ./includes/topics/capabilities.php, line 174 and
    ./includes/replies/capabilities.php, line 156

    // Moderators can always edit forum content
    	} elseif ( user_can( $user_id, 'moderate' ) ) {
    		$caps[] = 'moderate';
    					
    // -------------------------------- 
    // User is author so allow edit if not in admin
    	} elseif ( !is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) {
    	        $caps[] = $post_type->cap->delete_posts;
    // --------------------------------
    					
    // Unknown so map to delete_others_posts

    So my question is: is this intended ? Otherwise is there a fix planned for a next update?
    Thank you for your help.
    Regards.

Viewing 4 replies - 1 through 4 (of 4 total)

  • tech55541
    Participant

    @tech55541

    Hello there,
    What exactly does this code do? Does it allow participants to delete or trash posts? That is my question.
    I enable the capability for participants to delete posts, but they cannot delete if they cannot trash the post first. The only way for trash to show up is to enable the moderate capability which opens up way to many options. Is there any way to modify this code to only allow participants to trash their posts?

    Thanks.


    LeGuerg
    Participant

    @isa_admin

    Hi,

    This code allows the author of a topic/reply to trash his own posts. This way, there is no need to give a moderate capability to Participants.

    Regards.


    tech55541
    Participant

    @tech55541

    Hello,
    Where does this code go?

    Thanks.


    sarwarc
    Participant

    @sarwarc

    Hi LeGuerg,

    Thanks for the useful post. I have added those lines of code in two php files that you mentioned, but still particants can’t delete their own posts.

    /home/XXX/public_html/XXX/wp-content/plugins/bbpress/includes/replies/capabilities.php
    /home/XXX/public_html/XXX/wp-content/plugins/bbpress/includes/topics/capabilities.php

    Any idea why? Anyone’s help will help will be greatly appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar