vapvarun

open all buddypress activity links in new tab

Feb 24th, 2021
1,167
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // open all buddypress activity links in new tab
  2. function vap_activity_links_target_blank($link) {
  3.     $link = str_replace(' rel="nofollow ugc"','target="_blank" rel="nofollow ugc"',$link);
  4.     return $link;
  5.  
  6. }
  7.  
  8. add_filter('bp_get_activity_content','vap_activity_links_target_blank',20);
  9. add_filter('bp_get_activity_content_body','vap_activity_links_target_blank',20);
  10. add_filter('bp_get_activity_parent_content','vap_activity_links_target_blank',20);
  11. add_filter('bp_get_activity_latest_update','vap_activity_links_target_blank',20);
  12. add_filter('bp_get_activity_latest_update_excerpt','vap_activity_links_target_blank',20);
  13. add_filter('bp_get_activity_feed_item_description','vap_activity_links_target_blank',20);
  14. add_filter('bp_get_activity_feed_item_description','vap_activity_links_target_blank',20);
  15.  
RAW Paste Data