wp_rel_nofollow

函数
wp_rel_nofollow ( $text )
参数
  • (string) $text Content that may contain HTML A elements.
    Required:
返回值
  • (string) Converted content.
定义位置
相关方法
wp_rel_nofollow_callbackwp_kses_no_nullwp_rel_callbackwp_rel_ugcwp_preload_dialogs
引入
1.5.0
弃用
-

wp_rel_nofollow: 这个函数用于向一个链接添加rel=”nofollow”属性。它接受几个参数,包括链接的属性。

为内容中的所有HTML A元素添加`rel="nofollow"`字符串。

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 );
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-13 17:36:12

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: