Hi,
I am having the same problem. I don’t want the users on a forum to be able to see their own or others profiles at all. The page “user base” should in other words not be able to reach.
How do I even remove the hyperlink from the profiles?
Thanks! 🙂
Button9
Add a filter that removes the links.
Copy the code below into your function.php file: (you might need to add <?php at the start and ?> at the end)
add_filter( ‘bbp_get_author_link’, ‘remove_author_links’, 10, 2);
add_filter( ‘bbp_get_reply_author_link’, ‘remove_author_links’, 10, 2);
add_filter( ‘bbp_get_topic_author_link’, ‘remove_author_links’, 10, 2);
function remove_author_links($author_link, $args) {
$author_link = preg_replace(array(‘{<a[^>]*>}’,'{}’), array(”,”), $author_link);
return $author_link;
}
Thank you for your answer Koendb!
Looks like I’m doing something wrong. After having copied your code into my functions.php under themes and customizr, both just as you wrote it and with the <?php and ?> as below, my webpage disappears and goes completely blank until I remove everything again. Why might that be?
<?php add_filter( ‘bbp_get_author_link’, ‘remove_author_links’, 10, 2); ?>
<?php add_filter( ‘bbp_get_reply_author_link’, ‘remove_author_links’, 10, 2); ?>
<?php add_filter( ‘bbp_get_topic_author_link’, ‘remove_author_links’, 10, 2); ?>
function remove_author_links($author_link, $args) {
$author_link = preg_replace(array(‘{<a[^>]*>}’,'{}’), array(”,”), $author_link);
return $author_link;
}
Copy and paste in your php function code below:
<?php
add_filter( 'bbp_get_author_link', 'remove_author_links', 10, 2);
add_filter( 'bbp_get_reply_author_link', 'remove_author_links', 10, 2);
add_filter( 'bbp_get_topic_author_link', 'remove_author_links', 10, 2);
function remove_author_links($author_link, $args) {
$author_link = preg_replace(array('{<a[^>]*>}','{}'), array(","), $author_link);
return $author_link;
}
?>
Thank you for helping me!
I have tried that too, with the same effect, everything disappears. If I am working in the wordpress dashboard even that disappears.
Best regards,
Button9
I haven’t got a clue what that problem might be, I’m sorry. Did you upload a valid functions.php in between your different tries (with/without <?php ?>) ?
(and yes, I see my code could be a little shorter, feel free to optimize this :))
Yes I have done that too.
This is very strange. Are there any other alternatives that I could try?
🙂
Best regards,
Button9
Hello again,
I am starting to accept that I might not get rid of this hyperlink or the “user base” page.
But there are some strange things on this page that I would like to fix. The profile picture that shows seems to be the last one uploaded to the media library, preferably I would like to show nothing at all. Also in the bottom of the profile page is a button that says “older entries” as in my news page, and when I hit that I get the “Ooops the page was not found” error. So strange. 🙂
Best regards,
Button9
I got it to work now! The solution was to put the code you guys gave me in the beginning of the functions.php. I should probably have known that 🙂
Now one more thing; what can I add to also remove the link that is on your own name/profile after you have logged in to the forum?
Thank you!
Best regards,
Button9