Skip to:
Content
Pages
Categories
Search
Top
Bottom

How To Remove Sub-Reply Button?


  • JamieWade
    Member

    @jamiewade

    Was wondering how to remove the reply to comments button? I figured there would be a huge formatting problem with many subsequent replies to people’s other replies. Here is a picture to show what I want to do. Please any help would be greatly appreciated:
    Photobucket

Viewing 11 replies - 1 through 11 (of 11 total)

  • JamieWade
    Member

    @jamiewade

    Worked it out! For those who are interested in how to do this, you need to go to wp-content/plugins/buddypress/bp-activity/bp-activity-templatetags.php and delete this code:

    `if ( is_user_logged_in() )
    $content .= ‘ · id . ‘” class=”acomment-reply” id=”acomment-reply-‘ . $activities_template->activity->id . ‘”>’ . __( ‘Reply’, ‘buddypress’ ) . ‘‘;`


    Virtuali
    Participant

    @gunju2221

    Anytime you make changes to the core you will lose them next time you update buddypress.


    Brandon Allen
    Participant

    @cnorris23

    You might try this rather than a core hack.

    `function my_filter_activity_comment_reply_links( $content ) {
    preg_replace( ‘().*?()’, ”, $content );

    return $content;
    }
    add_filter( ‘bp_activity_recurse_comments’, ‘my_filter_activity_comment_reply_links’ );`

    I have not tested this, but, fingers crossed, it should work.


    James
    Participant

    @janismo

    hi @cnorris23 ,

    fingers did not help, function returns:

    Warning: preg_replace() [function.preg-replace]: Unknown modifier ‘.’ in …… on line 2


    Virtuali
    Participant

    @gunju2221

    You need to put this in your bp-custom.php


    James
    Participant

    @janismo

    hi @gunju2221 ,

    did you really checked it with bp-custom?
    for me it returns same warning, not depending from where I put it.

    you can try this: haven’t tested it…

    replace the preg_replace in fns.
    `
    preg_replace( ‘#(.*)#s’, ”, $content);
    `


    James
    Participant

    @janismo

    thanks Alan, this does not return warnings, but does not remove sub-replies too :)


    Brandon Allen
    Participant

    @cnorris23

    Try this:

    `function my_filter_activity_comment_reply_links( $content ) {
    preg_replace( ‘/()(.*)()/g’, ”, $content);

    return $content;
    }`

    Also, it should be noted that this code is not restricted to your bp-custom.php file. It can also go in your theme’s functions.php file.


    James
    Participant

    @janismo

    thanks @cnorris23 ,
    but did not work for me again, don’t know, maybe I have some other function, which does not allow this one to work correctly. probably, will have to change core file and put it in some reminder.


    Brandon Allen
    Participant

    @cnorris23

    I haven’t been testing these. I’ll try to test tonight and get you a working one. A core hack the last thing you want to do.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How To Remove Sub-Reply Button?’ is closed to new replies.
Skip to toolbar