Skip to:
Content
Pages
Categories
Search
Top
Bottom

How To Remove Sub-Reply Button?

  • @jamiewade

    Member

    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

    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’ ) . ‘‘;`

    @gunju2221

    Participant

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

    @cnorris23

    Participant

    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.

    @janismo

    Participant

    hi @cnorris23 ,

    fingers did not help, function returns:

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

    @gunju2221

    Participant

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

    @janismo

    Participant

    hi @gunju2221 ,

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

    @uloga

    Member

    you can try this: haven’t tested it…

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

    @janismo

    Participant

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

    @cnorris23

    Participant

    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.

    @janismo

    Participant

    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.

    @cnorris23

    Participant

    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