WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/popuplinks

Contents

Description

Adds target='_blank' and rel='external' to all HTML Anchor tags 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.

Usage

<?php popuplinks$text ?>

Parameters

$text
(string) (required) Content to replace links to open in a new window.
Default: None

Return Values

(string) 
Content that has filtered links.

Examples

Default usage

<?php
echo popuplinks('Please visit <a href="http://www.wordpress.com">WordPress.com</a>.');
?>

Will output:

Please visit <a href="http://www.wordpress.com" target='_blank' rel='external'>WordPress.com</a>

Notes

Change Log

Since: 0.71

Source File

popuplinks() is located in wp-includes/formatting.php.

Related

See also index of Function Reference and index of Template Tags.