Skip to:
Content
Pages
Categories
Search
Top
Bottom

Is there a way to remove this character "|" next to the subscription link?

Viewing 25 replies - 1 through 25 (of 26 total)

  • Robin W
    Moderator

    @robin-w

    This is related to the plugin/theme your are using that displays “click to receive”.

    Which one are you using ?


    Majijiboo
    Participant

    @majid436

    The theme is Divi which is from Elegant Themes and the plugin is BBpress Notify. I used the below function to change it from Subscribe to “Click to receive…”. Thanks.

    
    function change_translate_text4( $translated_text ) {
        if ( $translated_text == 'Subscribe' ) {
        $translated_text = 'Click to receive an email notification when a member responds below';
        }
        return $translated_text;
    }
    add_filter( 'gettext', 'change_translate_text4', 20 );
    

    Robin W
    Moderator

    @robin-w

    Ok, sorry yes I get it now !

    Try

    function hide_before ($args = array() ) {
    $args['before'] = '';
    return $args;
    }
    add_filter ('bbp_before_get_forum_subscribe_link_parse_args','hide_before') ;
    

    Let me know if it works – it is blank by default, so not sure why your’s has a | in it.


    Majijiboo
    Participant

    @majid436

    It works! Thank you.


    Robin W
    Moderator

    @robin-w

    great !


    Majijiboo
    Participant

    @majid436

    So, the same character “|” comes up for the “unsubscribe” button? See link below for an image. What function should I use to remove that? Thx.

    http://awesomescreenshot.com/0c12lq5f6a


    Robin W
    Moderator

    @robin-w

    hmmm.. it is the same function that does both, but as I said before normally it is blank, so my solution above should not have worked, but did.

    Can you send me a link to that page, and I’ll take a look.


    Majijiboo
    Participant

    @majid436

    Sure, go to this link http://www.manupmyhealth.com/forums/topic/test/
    Thanks.


    Robin W
    Moderator

    @robin-w

    I’ve had a look, but I can’t find what is doing this – must be buried deep

    If you keep toggling the | comes back, so my original code isn’t doing anything.

    The codes resolves as

    <span id=”subscription-toggle”>
    |
    <span id=”subscribe-2072″>
    Click to receive an email notification when a member responds below

    so it’s in the subscription part, but not part of the url.


    Majijiboo
    Participant

    @majid436

    Ok, thanks for taking a look.

    Rather than the forum subscribe link we are actually in a topic ;)

    bbPress has the two default links ‘Favorite’ and ‘Subscribe’ seperated by a |

    The default before args forbbp_get_topic_subscription_link is 'before' => '&nbsp;|&nbsp;', so the below fork of Robin’s code should do what you need.

    function hide_before ($args = array() ) {
    $args['before'] = '';
    return $args;
    }
    add_filter ('bbp_before_get_topic_subscribe_link_parse_args','hide_before')

    Majijiboo
    Participant

    @majid436

    Thanks. I entered the below function and it did not fix the issue. Any idea why? Thx.

    
    function hide_before2 ($args = array() ) {
    $args['before'] = '';
    return $args;
    }
    add_filter ('bbp_before_get_topic_subscribe_link_parse_args','hide_before2');
    

    Robin W
    Moderator

    @robin-w

    ahh! that’s it

    difference between

    ‘bbp_before_get_topic_subscribe_link_parse_args’

    and

    bbp_before_get_topic_subscription_link_parse_args

    So

    function hide_before2 ($args = array() ) {
    $args['before'] = '';
    return $args;
    }
    add_filter ('bbp_before_get_topic_subscription_link_parse_args','hide_before2');
    

    will do it !


    Majijiboo
    Participant

    @majid436

    Thanks. It works when you go to the topic page, but after you click on the subscribe link it will reappear. Any idea if there’s another function I should add? Thx.

    Ha! Copy pasta, my bad… Maybe a cache issue, try flushing your browsers cache.


    Majijiboo
    Participant

    @majid436

    I’ve tried on Safari and Chrome after clearing cache and no luck. “|” fortunately doesn’t show when you go to the topic page. It’s after you click the “subscribe” or “unsubscribe” button, where it then displays.


    Robin W
    Moderator

    @robin-w

    weird, I’ll try it on my test site when I get a moment !


    Robin W
    Moderator

    @robin-w

    I’ve just spent two hours debugging this, I’ve found three errors, fixed it once only for it to come back.

    I give up for the moment !


    Majijiboo
    Participant

    @majid436

    Thanks for giving it a good try. Really appreciate it.


    Robin W
    Moderator

    @robin-w

    it will not defeat me, but just need to lick wounds for a few days, then I’ll be back !


    tharsheblows
    Participant

    @tharsheblows

    I think it’s the ajax call that’s doing it. So you would need to filter the bbp_get_user_subscribe_likelink like this – this also includes the bits to change your subscribe and unsubscribe links:

    function hide_before2 ($args = array() ) {
    $args['before'] = '&nbsp';
    $args['subscribe'] = 'Click to receive an email notification when a member responds below';  
    $args['unsubscribe'] = 'Unsubscribe'; // or whatever
     
     return $args;
    } 
    
    add_filter('bbp_before_get_user_subscribe_link_parse_args', 'hide_before2');

    Robin W
    Moderator

    @robin-w

    glad to have someone else looking !

    My ajax is hopeless !

    Your solution is valid, but digging for it produced some code issue

    we have several issues here

    firstly the filter call is wrong in the code ie

    bbpress/includes/topics/template.php has two errors

    function bbp_get_topic_subscription_link( $args = array() ) {
    ......Parse the arguments......
    		), 'get_forum_subscribe_link' );

    so the function is ‘get_topic_subscription’ but the parse argument reverts to ‘get_forum_subscribe

    whilst it doesn’t affect this issue the error is repeated for favorites in the same file

    function bbp_get_topic_favorite_link( $args = array() ) {
    ..........), 'get_forum_favorite_link' );
    

    needs changing to ‘get_topic_favorite_link’`

    This doesn’t affect the issue as such, other than the filters above are wrong.

    But filtering bbp_get_topic_subscription_link is totally pointless, as it immediately calls
    ‘get_user_subscribe_link’ which them resets the |, so whilst the filter seems to correct it once, any click just resets it.

    So your filter to get_user_subscribe_link is the correct one, but for the wrong reason.

    Really the code needs to have the filter in one place only (suspect user)

    Anyway the solution for @majid436 is as you suggest

    function hide_before3 ($args = array() ) {
    $args['before'] = '';
    return $args;
    }
    add_filter ('bbp_before_get_user_subscribe_link_parse_args','hide_before3');
    

    Robin W
    Moderator

    @robin-w

    I’ve submitted a trac ticket to improve the code !


    Majijiboo
    Participant

    @majid436

    It works! Thanks for the team effort.


    Robin W
    Moderator

    @robin-w

    glad we got there !

Viewing 25 replies - 1 through 25 (of 26 total)

You must be logged in to reply to this topic.