Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove access to edit profile code error, anyone help?

  • @zapsplated

    Participant

    Hello. I want to disable the edit profile link on my forum using bbpress, which I have found the following code to add to functions.php. It works, except for next to the username and profile pictures there is a comma, and it looks messy… anyone with php knowledge know why this code is producing a comma next to the username and profile pic?

    Thanks

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

Viewing 1 replies (of 1 total)
  • @casiepa

    Moderator

    I haven’t used preg_replace in years, but I think the 2nd parameter is what it needs to put as replacement string. You seem to tell that you want a comma : array(“,”). I suppose you want a space ? array(” “)

    Didn’t try, just guessing !

    Pascal.

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