Update For BuddyPress Blog Author Link Plugin

BP Blog Author Profile Link is a plugin by Ron Rennick which hasn’t been updated in over 2 years. It enabled the author link on a post/page links to the author’s buddypress profile.

If you are having issue with this plugin when network is activated, please read on.

Open the plugin file and look for line 36:

$member_url = network_home_url( BP_MEMBERS_SLUG );

Change this into

$member_url = home_url( BP_MEMBERS_SLUG );

Here is a more awesome way which you can directly paste into your functions.php. (No more update available from plugin author) This function is only activated when Buddypress is enabled.

if( function_exists( 'bp_is_active' ) ):
function ra_add_author_filter() {
add_filter( 'author_link', 'ra_bp_filter_author' );
}
add_action( 'wp_head', 'ra_add_author_filter' );
function ra_bp_filter_author( $content ) {
if( defined( 'BP_MEMBERS_SLUG' ) ) {
if( is_multisite() ) {
$member_url = home_url( BP_MEMBERS_SLUG );
if( !is_subdomain_install() && is_main_site() )
$extra = '/blog';
else
$extra = '';
$blog_url = get_option( 'siteurl' ) . $extra . '/author';
return str_replace( $blog_url, $member_url, $content );
}
return preg_replace( '|/author(/[^/]+/)|', '/' . BP_MEMBERS_SLUG . '$1' . 'profile/', $content );
}
return $content;
}
endif;

Leave a Reply