Is there a way to remove this character "|" next to the subscription link?
-
Is there a way to remove this character “|” next to the subscription toggle? See link to image below for what I’m referring to. Thanks.
-
This is related to the plugin/theme your are using that displays “click to receive”.
Which one are you using ?
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 );
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.
It works! Thank you.
great !
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.
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.
Sure, go to this link http://www.manupmyhealth.com/forums/topic/test/
Thanks.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 belowso it’s in the subscription part, but not part of the url.
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 for
bbp_get_topic_subscription_link
is'before' => ' | ',
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')
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');
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 !
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.
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.
weird, I’ll try it on my test site when I get a moment !
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 !
Thanks for giving it a good try. Really appreciate it.
it will not defeat me, but just need to lick wounds for a few days, then I’ll be back !
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'] = ' '; $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');
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');
I’ve submitted a trac ticket to improve the code !
It works! Thanks for the team effort.
glad we got there !
- You must be logged in to reply to this topic.