wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



wp_rel_ugc › WordPress Function

Od5.3.0
Przestarzałyn/a
wp_rel_ugc ( $text )
Parametry:
  • (string) $text Content that may contain HTML A elements.
    Wymagane: Tak
Powrót:
  • (string) Converted content.
Zdefiniowane na:
Codex:

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



Źródło

function wp_rel_ugc( $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 ugc' );
		},
		$text
	);
	return wp_slash( $text );
}