Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Delete Post by It’s Owner


iftomkins
Participant

@iftomkins

Hi! I’m a little late on this one. Using bbpress 2.0 but the above code still kinda works. When I add it, I get the edit button, but no delete button. Any tips? I want all users to be able to edit and delete their own posts. Also, I’m confused whether assigning someone the role Forum Participant vs. Subcriber has anything to do with it, but I’ve tried both. Here’s the code I was using from above:

function delete_own_post($retvalue, $capability, $args) {
if ($capability=="delete_post") {return bb_current_user_can( 'edit_post', $args[1]);}
return $retvalue;
}
add_filter('bb_current_user_can', 'delete_own_post',10,3);

Skip to toolbar