This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

_make_web_ftp_clickable_cb( array $matches )

Callback to convert URL match to HTML A element.


Description

This function was backported from WP-2.5.0 to WP-2.3.2. Regex callback for make_clickable().


Parameters

$matches

(array) (Required) Single Regex Match.


Return

(string) HTML A element with URL address.


Source

File: wp-includes/formatting.php

function _make_web_ftp_clickable_cb( $matches ) {
	$ret = '';
	$dest = $matches[2];
	$dest = 'http://' . $dest;

	// removed trailing [.,;:)] from URL
	if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) {
		$ret = substr($dest, -1);
		$dest = substr($dest, 0, strlen($dest)-1);
	}

	$dest = esc_url($dest);
	if ( empty($dest) )
		return $matches[0];

	return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a>$ret";
}


Changelog

Changelog
Version Description
WP-2.3.2 Introduced.