Hi Emmanuel,
It is possible to do so by filtering on ‘mpp_settings’ and updating the value for this key
‘enable_gallery_comment’ based on role.
Please give it a try and let me know if that works for you or not?
I tried this but wasn’t successful. What is the signature of mmp_settings. Was i a bit naive with my code?
function custom_comment_restrict($keys){
if(!current_user_can('access_s2member_level1')){
$keys['enable_gallery_comment'] = false;
}
return $keys;
}
add_filter('mpp_settings', 'custom_comment_restrict');
That should have worked. Can you please check for subscriber role the same thing?
Ah ok It does work, I should have been more specific with my question. I also needed the key for commenting on single media. Which I presume is $keys['enable_media_comment']
.
I’ve know disabled commenting on single media and galleries. Thanks again.
(@unuigbee)
8 years, 1 month ago
Hi,
I’d like restrict certain users from commenting on galleries in group galleries and in the lightbox for a particular gallery.
I’ve been trying to use these BuddyPress filters
bp_get_activity_comment_form_action
andbp_get_activity_comment_link
combined with ‘current_user_can’ to achieve this. But I haven’t been successful.Guidance would be much appreciated.
Regards,
Emmanuel
https://wordpress.org/plugins/mediapress/