Snoopy::_striplinks()publicWP 1.0

Метод класса: Snoopy{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$Snoopy = new Snoopy();
$Snoopy->_striplinks( $document );
$document (обязательный)
-

Код Snoopy::_striplinks() WP 6.5.2

function _striplinks($document)
{
	preg_match_all("'<\s*a\s.*?href\s*=\s*			# find <a href=
					([\"\'])?					# find single or double quote
					(?(1) (.*?)\\1 | ([^\s\>]+))		# if quote found, match up to next matching
												# quote, otherwise match up to next space
					'isx",$document,$links);


	// catenate the non-empty matches from the conditional subpattern

	foreach ( $links[2] as $key => $val )
	{
		if(!empty($val))
			$match[] = $val;
	}

	foreach ( $links[3] as $key => $val )
	{
		if(!empty($val))
			$match[] = $val;
	}

	// return the links
	return $match;
}