Add target blank to user link in recent comments widget

Open author link in new tab in wordpress default recent comments widget.

I just discovered it today itself on webdeveloeprswall. I’ve added a recent comments widget in my sidebar. The widget is a default wordpress widget, many of us use it. But when you click on the author link in the widget(sidebar) the commentor’s url (whatever he/she has provided) open in the same window!! Taking visitors away from your own website.

I immediately felt the need to add a target="_blank" attribute to those links. So here’s the small code snippet i came up with. Just add the below lines of code in your theme’s functions.php file:

<?php 
/**
 * http://webdeveloperswall.com/wordpress/add-target-blank-to-user-link-in-recent-comments-widget
**/
function add_blank_get_comment_author_link($link){
	$rep_count = 1;
	$new_ret = str_replace("<a", "<a target='_blank'", $link, $rep_count);
	return $new_ret;
}
add_filter('get_comment_author_link', 'add_blank_get_comment_author_link', 10, 2);
?>

and now the author links from recent comments open in new tab, hurray!! 🙂

Hope you find it useful. Cheers

Buddypress Message Attachment Plugin

Yippee, my first plugin in wordpress repo. 🙂

A plugin for giving users the option to send attachment to each other in private messages. Users can send file attachment to each other in private messages as well in replies to those messages.
Check the screenshots below:
private message attachmentbuddypress attachemnt in message

You can download the plugin from wordpress repo here

The plugin was originally developed keeping audio/video attachments in mind, so the option to wrap audio/video attachments in HTML5 audio/video tags is still there.

Drop in your comments if you found it useful, or if you find any bugs.


Buddypress mention plugin

buddypress username mention
bp mention

A buddypress plugin to add username mention in status updates, comments, etc. with autosuggest dropdown of friends name.

This is an unofficial plugin. The same functionality is provided in BP Labs plugin which is from one of the core developers of buddypress. So there’s no way i am adding this pluing into wordpress repo 🙂

Then why this plugin?
Well.. the BP Labs didn’t work for me, neither on my localhost, nor on my server. But that doesn’t mean it wont work for you as well. Anyway so this didn’t work for me and i had a slightly altered requirement. BP Labs only displays the usernames in the autosuggest list, i wanted fullnames as the users wont know all the time the username of their friend, but they would definitely know their full name.

So that’s one difference. I’ve made this plugin from ground up and not by tweaking BP Labs as BP Labs has other functions as well apart form username mention.

Enough talking, if you want you can grab a copy of my plugin from the download link given at the end of this post.
Hope you find it useful.
And do drop in your feedback.