WordPress at Your Fingertips
function is not described

SimplePie_Sanitize::replace_urls() public WP 1.0

{} It's a method of the class: SimplePie_Sanitize{}

No Hooks.

Return

null. Nothing.

Usage

$SimplePie_Sanitize = new SimplePie_Sanitize();
$SimplePie_Sanitize->replace_urls( $document, $tag, $attributes );
$document (required)
-
$tag (required)
-
$attributes (required)
-

Code of SimplePie_Sanitize::replace_urls() WP 5.8.2

public function replace_urls($document, $tag, $attributes)
{
	if (!is_array($attributes))
	{
		$attributes = array($attributes);
	}

	if (!is_array($this->strip_htmltags) || !in_array($tag, $this->strip_htmltags))
	{
		$elements = $document->getElementsByTagName($tag);
		foreach ($elements as $element)
		{
			foreach ($attributes as $attribute)
			{
				if ($element->hasAttribute($attribute))
				{
					$value = $this->registry->call('Misc', 'absolutize_url', array($element->getAttribute($attribute), $this->base));
					if ($value !== false)
					{
						$element->setAttribute($attribute, $value);
					}
				}
			}
		}
	}
}