Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove hyperlink from user name

  • @aleqx03

    Participant

    Hi,

    I am currently looking into an issue, for which I didnt find any solution:

    Since I am using the WordPress backend for profile editing, i dont want to give the user any access to the build in bbpress profile page. How can I disable this? I think the easiest way is to disable the link from the user name, but if you have a better idea i will be glad to hear it 🙂

    Any input is much appreciated!!

    aleqx

Viewing 10 replies - 1 through 10 (of 10 total)
  • @aleqx03

    Participant

    – push –

    @button9

    Participant

    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

    @koendb

    Participant

    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;
    }

    @button9

    Participant

    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;
    }

    @freewpress

    Participant

    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;
    }
    ?>

    @button9

    Participant

    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

    @koendb

    Participant

    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 :))

    @button9

    Participant

    Yes I have done that too.

    This is very strange. Are there any other alternatives that I could try?

    🙂

    Best regards,
    Button9

    @button9

    Participant

    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

    @button9

    Participant

    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

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
Skip to toolbar