Search code examples
wordpressbuddypress

Hide activity comments form when changing tab


By default Buddypress opens the comments form when clicking a new tab (All members, My friends, My favorites, ...).

Is it someone could tell me how not to display this form please ? Thank you.


Solution

  • This requires editing a core Buddypress file. If anyone know how to do this via theme files, please post.

    In wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js, you'll find a function called bp_activity_request around line 1143.

    Modify the jq('div.activity').fadeOut() callback thusly:

    Before:

    jq('div.activity').fadeOut( 100, function() {
        jq(this).html(response.contents);
        jq(this).fadeIn(100);
    
        /* Selectively hide comments */
        bp_dtheme_hide_comments();
    });
    

    After:

    jq('div.activity').fadeOut( 100, function() {
        jq(this).html(response.contents);
        jq('form.ac-form').hide(); // added line to hide forms
        jq(this).fadeIn(100);
    
        /* Selectively hide comments */
        bp_dtheme_hide_comments();
    });