popuplinks

Adds element attributes to open links in new windows.

Description

(string) popuplinks( (string) $text ); 

Returns (string)

Content that has filtered links.

Parameters (1)

0. $text (string)
Content to replace links to open in a new window.

Usage

  1. if ( !function_exists( 'popuplinks' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // Content to replace links to open in a new window. 
  5. $text = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = popuplinks($text); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/deprecated.php  
  1. function popuplinks( $text ) { 
  2. _deprecated_function( __FUNCTION__, '4.5.0' ); 
  3. $text = preg_replace('/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text); 
  4. return $text;