Automattic\WooCommerce\Vendor\Symfony\Component\CssSelector\XPath\Extension
PseudoClassExtension::translateOnlyOfType
Method of the class: PseudoClassExtension{}
No Hooks.
Returns
null. Nothing (null).
Usage
$PseudoClassExtension = new PseudoClassExtension(); $PseudoClassExtension->translateOnlyOfType( $xpath ): XPathExpr;
- $xpath(XPathExpr) (required)
- .
PseudoClassExtension::translateOnlyOfType() 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));
}