WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

SimplePie_Sanitize::strip_tag() protected WP 1.0

{} Это метод класса: SimplePie_Sanitize{}

Хуков нет.

Возвращает

Null. Ничего.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->strip_tag( $tag, $document, $xpath, $type );

Код SimplePie_Sanitize::strip_tag() WP 5.5.3

<?php
protected function strip_tag($tag, $document, $xpath, $type)
{
	$elements = $xpath->query('body//' . $tag);
	if ($this->encode_instead_of_strip)
	{
		foreach ($elements as $element)
		{
			$fragment = $document->createDocumentFragment();

			// For elements which aren't script or style, include the tag itself
			if (!in_array($tag, array('script', 'style')))
			{
				$text = '<' . $tag;
				if ($element->hasAttributes())
				{
					$attrs = array();
					foreach ($element->attributes as $name => $attr)
					{
						$value = $attr->value;

						// In XHTML, empty values should never exist, so we repeat the value
						if (empty($value) && ($type & SIMPLEPIE_CONSTRUCT_XHTML))
						{
							$value = $name;
						}
						// For HTML, empty is fine
						elseif (empty($value) && ($type & SIMPLEPIE_CONSTRUCT_HTML))
						{
							$attrs[] = $name;
							continue;
						}

						// Standard attribute text
						$attrs[] = $name . '="' . $attr->value . '"';
					}
					$text .= ' ' . implode(' ', $attrs);
				}
				$text .= '>';
				$fragment->appendChild(new DOMText($text));
			}

			$number = $element->childNodes->length;
			for ($i = $number; $i > 0; $i--)
			{
				$child = $element->childNodes->item(0);
				$fragment->appendChild($child);
			}

			if (!in_array($tag, array('script', 'style')))
			{
				$fragment->appendChild(new DOMText('</' . $tag . '>'));
			}

			$element->parentNode->replaceChild($fragment, $element);
		}

		return;
	}
	elseif (in_array($tag, array('script', 'style')))
	{
		foreach ($elements as $element)
		{
			$element->parentNode->removeChild($element);
		}

		return;
	}
	else
	{
		foreach ($elements as $element)
		{
			$fragment = $document->createDocumentFragment();
			$number = $element->childNodes->length;
			for ($i = $number; $i > 0; $i--)
			{
				$child = $element->childNodes->item(0);
				$fragment->appendChild($child);
			}

			$element->parentNode->replaceChild($fragment, $element);
		}
	}
}