Definition:
function popuplinks($text) {}
Adds a element attributes to open links in new windows.
Comment text in popup windows should be filtered through this. Right now it’s a moderately dumb function, ideally it would detect whether a target or rel attribute was already there and adjust its actions accordingly.
Parameters
- string $text: Content to replace links to open in a new window.
Return values
returns:Content that has filtered links.
Source code
function popuplinks($text) { $text = preg_replace('/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text); return $text; }
2545
No comments yet... Be the first to leave a reply!