BuddyDev

Search

hiding comments

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3021
    Ravi on #29443

    Hello Rav,

    I have look into it and found that BuddyPress on single user profile activity tab override the “display_comments” value based on the scope. Please try the following code it will not display comments on User personal activity tab.

    
    // this one is working for member's activity should i post this code.
    add_filter( 'bp_activity_set_just-me_scope_args', function ( $scope_args, $r ) {
    
    	if ( isset( $scope_args['override'], $scope_args['override']['display_comments'] ) ) {
    		$scope_args['override']['display_comments'] = false;
    	}
    
    	return $scope_args;
    }, 10, 2 );
    
    

    Please let me know if it works or not.

    Regards
    Ravi

  • Participant
    Level: Enlightened
    Posts: 36
    rav on #29448

    It seems that the code completely delate the comments section. It wasn’t quite the point. I meant curl so that they were visible but only after clicking

    • This reply was modified 4 years, 1 month ago by rav.
  • Participant
    Level: Enlightened
    Posts: 36
    rav on #29450
  • Keymaster
    (BuddyDev Team)
    Posts: 24315
    Brajesh Singh on #29492

    Hi Rav,
    I have looked at it and now I will be able to help you.

    1. The link you shared is for BP Legacy template pack not for nouveau.
    2. Modifying a minified asset is not a great idea.

    Now, that we are clear about it, You will need to make change sin buddypress/bp-templates/bp-nouveau/buddypress-activity.min.js or buddypress-activity.js(depending on whether SCRIPT_DEBUG is defined or not).

    here is a screenshot form the minified file.
    https://i.imgur.com/TlDEvUV.png

    In the non minified file, it is in a method named hideComments.

    These take care of the comments even after loading via load more in Nouveau.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved