Hi Guys!
Is possible to disable the rtmedia comment action in the post until the users are become friends?
THANK YOU!!!
Hi John,
I am sorry, we are not using RT Media. So, I and my team may not be able to assist with it. I hope that someone form the community is able to help you.It should not be difficult as you can check on the $activity_type from this function.
Or, if you can tell me their activity type(is it rtm_update?), I can assist with the code.
Regards
BrajeshHi Brajesh,
I really appreciate your help.Looks like is rtmedia_update
In their documentation they have this:
Adding rtMedia updates to activity show dropdown
Notes: Starting version 4.2.1, this functionality does not require a filter as this code has been moved to rtMedia CoreIf you want to add or rename rtMedia updates in activity’s show dropdown, use the following piece of code in your function.php file:
add_filter(‘bp_get_activity_show_filters_options’, ‘add_media_show_filter’, 10, 2);function add_media_show_filter( $filters, $context ){
$filters[‘rtmedia_update’] = ‘rtMedia Updates’;
return $filters;
}
ORUse this code: if you are using old buddypress templates in your theme.
add_action( ‘bp_activity_filter_options’, ‘rtmedia_update_filter’ );
function rtmedia_update_filter() {
echo ‘<option value=”rtmedia_update”>rtMedia Updates</option>’;
}Thank you so much!
Hi John,
Sorry for the delay.Here is the code for hiding the update.
add_filter( 'bp_activity_can_comment', function ( $can, $activity_type ) { // already protected, return. if ( ! $can || 'rtmedia_update' !== $activity_type ) { return $can; } $logged_user_id = get_current_user_id(); $activity_user_id = bp_get_activity_user_id(); // if not user's own activity, or not super admin // and the current user is not friends with the activity user, disable comment. if ( $logged_user_id != $activity_user_id && ! is_super_admin() && function_exists( 'friends_check_friendship' ) && ! friends_check_friendship( $logged_user_id, $activity_user_id ) ) { $can = false; } return $can; }, 20, 2 );
About MediaPress:- We love when people use MediaPress but we do not recommend switching to it just due to one rating addon. I will recommend sticking with whatever plugin you are using if that works for most of the features. That will create less friction for your members.
Regards
BrajesHi Brajesh,
the rtmedia is not working. Is this code to disable the rtmedia comment action in the rtmedia posts or is for the activity? I need it for the posts area.
I was trying your plugin but it was breaking my site 🙁 My problem with rtmedia is the support. I have not idea anything about coding and they are not helpfull at all. I got a issue with them and they did not resolve it. The solution was returning my money back for that add on…
Thank you!
is this helpfull?
http://hookr.io/plugins/rtmedia-for-wordpress-buddypress-and-bbpress/4.3.1/hooks/#index=r
thank you!
Hi John,
I am sorry, I am unable to comment where it will stop the comment. That will depend where that activity type is being used.I lack the time to test install RT Media and test it due to my current work. I hope you can give the above code to RT media people or someone using RT media to get assistance.
Regards
BrajeshThank you!
I really appreciate your coperation! 🙂
take care!
- This reply was modified 3 years, 1 month ago by John Elmer.
You must be logged in to reply to this topic.