SimplePie_Sanitize::replace_urls() public WP 1.0
{} Это метод класса: SimplePie_Sanitize{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
$SimplePie_Sanitize = new SimplePie_Sanitize(); $SimplePie_Sanitize->replace_urls( $document, $tag, $attributes );
- $document (обязательный)
- -
- $tag (обязательный)
- -
- $attributes (обязательный)
- -
Код SimplePie_Sanitize::replace_urls() SimplePie Sanitize::replace urls WP 5.7.1
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);
}
}
}
}
}
}