Automattic\WooCommerce\Vendor\Symfony\Component\CssSelector\XPath\Extension

PseudoClassExtension::translateOnlyOfTypepublicWC 1.0

Method of the class: PseudoClassExtension{}

No Hooks.

Returns

null. Nothing (null).

Usage

$PseudoClassExtension = new PseudoClassExtension();
$PseudoClassExtension->translateOnlyOfType( $xpath ): XPathExpr;
$xpath(XPathExpr) (required)
.

PseudoClassExtension::translateOnlyOfType() code WC 10.8.1

public function translateOnlyOfType(XPathExpr $xpath): XPathExpr
{
    $element = $xpath->getElement();

    return $xpath->addCondition(sprintf('count(preceding-sibling::%s)=0 and count(following-sibling::%s)=0', $element, $element));
}