Today tried testing this very ‘rough’ piece of code, failed hopelessly with my very limited knowledge of coding:
add_filter('bbp_topic_admin_links', 'rew_no_trash_except_own', 10, 2);
add_filter('bbp_reply_admin_links', 'rew_no_trash_except_own', 10, 2);
function rew_no_trash_except_own ($links, $topic_id) {
if (!bbp_is_user_keymaster() && !bbp_is_topic_author(get_current_user_id(), $topic_id)) {
unset($links['trash']);
}
return $links;
}
I think the direction is somewhat correct. Hope to get expert guide on this issue.
Regards.
you’re close !!
Untested, but try
add_filter('bbp_topic_admin_links', 'rew_no_trash_topic_except_own', 10, 2);
add_filter('bbp_reply_admin_links', 'rew_no_trash_reply_except_own', 10, 2);
function rew_no_trash_topic_except_own ($links, $topic_id) {
if (!bbp_is_user_keymaster() && get_current_user_id() != bbp_get_topic_author_id( $topic_id )) {
unset($links['trash']);
}
return $links;
}
function rew_no_trash_reply_except_own ($links, $reply_id) {
if (!bbp_is_user_keymaster() && get_current_user_id() != bbp_get_reply_author_id( $reply_id )) {
unset($links['trash']);
}
return $links;
}
Legend! It works exactly like what I want.
Thanks a lot!