WordPress at a glance

wp_rel_nofollow() WP 1.0

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

Возвращает

String. Converted content.

No Hooks.

Usage

wp_rel_nofollow( $text );
$text(string) (required)
Content that may contain HTML A elements.

Список изменений

С версии 1.5.0 Введена.

Code of wp_rel_nofollow() WP 5.5.1

wp-includes/formatting.php
<?php
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',
		function( $matches ) {
			return wp_rel_callback( $matches, 'nofollow' );
		},
		$text
	);
	return wp_slash( $text );
}

Related Functions

From tag: sanitize_

More from category: Formatting

No comments
    Log In . Register