Remove access to edit profile code error, anyone help?
-
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;
}
?>
- You must be logged in to reply to this topic.