WordPress at a glance
function is not described

_links_add_target() WP 2.7.0

Callback to add a target attribute to all links in passed content.

  • Global. String. $_links_add_target

No Hooks.

Return

String. The processed link.

Usage

_links_add_target( $m );
$m(string) (required)
The matched link.

Code of links add target: wp-includes/formatting.php VER 5.0.3

<?php
function _links_add_target( $m ) {
	global $_links_add_target;
	$tag = $m[1];
	$link = preg_replace('|( target=([\'"])(.*?)\2)|i', '', $m[2]);
	return '<' . $tag . $link . ' target="' . esc_attr( $_links_add_target ) . '">';
}