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



wp_rel_nofollow › WordPress Function

Depuis1.5.0
Dépréciéen/a
wp_rel_nofollow ( $text )
Paramètres:
  • (string) $text Content that may contain HTML A elements.
    Requis: Oui
Retourne:
  • (string) Converted content.
Défini(e) dans:
Codex:

Adds `rel="nofollow"` string to all HTML A elements in content.



Source

function wp_rel_nofollow( $text ) {
	// This is a pre-save filter, so text is already escaped.
	$text = stripslashes( $text );
	$text = preg_replace_callback(
		'|<a (.+?)>|i',
		static function ( $matches ) {
			return wp_rel_callback( $matches, 'nofollow' );
		},
		$text
	);
	return wp_slash( $text );
}