I'm developing a social network with Buddypress, I created a RSS plugin to pull the RSS feed from the specified websites. Everything is working, except when the RSS is posted to the activity stream. When I create the activity content to print a link, I set the link target to "_new" to open it in a new page. Here's the code:
function wprss_add_to_activity_feed($item, $inserted_ID) {
$permalink = $item->get_permalink();
$title = $item->get_title();
$admin = get_user_by('login', 'admin');
# Generates the link
$activity_action = sprintf( __( '%s published a new RSS link: %s - ', 'buddypress'), bp_core_get_userlink( $admin->ID ), '<a href="' . $permalink .'" target="_blank" title="'.$title.'">' . attribute_escape( wprss_limit_rss_title_chars($title) ) . '</a>');
/* Record this in activity streams */
bp_activity_add( array(
'user_id' => $admin->ID,
'item_id' => $inserted_ID,
'action' => $activity_action,
'component' => 'rss',
'primary_link' => $permalink,
'type' => 'activity_update',
'hide_sitewide' => false
));
}
It should come up with something like that:
<a href="link" target="_new" title="link">Test</a>
But it prints like that:
<a href="link" title="link">Test</a>
Why is this happening?