wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



_links_add_target › WordPress Function

Depuis2.7.0
Dépréciéen/a
_links_add_target ( $m )
Accès:
  • private
Paramètres:
  • (string) $m The matched link.
    Requis: Oui
Retourne:
  • (string) The processed link.
Défini(e) dans:
Codex:

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



Source

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 ) . '">';
}