Warning: This function has been deprecated.

popuplinks() WordPress Function

The popuplinks() function enables Wordpress developers to create links that open in a new window or tab. This is useful for linking to external sites, or for creating links that open a lightbox or modal window.

popuplinks( string $text ) #

Adds element attributes to open links in new tabs.


Parameters

$text

(string)(Required)Content to replace links to open in a new tab.


Top ↑

Return

(string) Content that has filtered links.


Top ↑

Source

File: wp-includes/deprecated.php

function popuplinks( $text ) {
	_deprecated_function( __FUNCTION__, '4.5.0' );
	$text = preg_replace('/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text);
	return $text;
}


Top ↑

Changelog

Changelog
VersionDescription
4.5.0This function has been deprecated.
0.71Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More