Removing Admin Link from Entire Forum
-
I would like to remove the LINK associated with the Admin username.
I placed the following into my child-theme’s functions.php file:
/* Remove link urls from forum author instances */ 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) { $user_id = bbp_get_reply_author_id( $reply_id ); $user_info = get_userdata($user_id); $bbpadmin = $user_info->user_login; if ($bbpadmin == "ADMINUSERNAME") { $author_link = preg_replace(array('{<a[^>]*>}','{}'), array(" "), $author_link); return $author_link; } else { return $author_link; } }
This works fine but I noticed the link still appears when viewing “last responded.” Removing the link from just Admin helps with security since the username won’t be out in the public.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.