Automattic\WooCommerce\EmailEditorVendor\Sabberworm\CSS\Property
Selector::getSpecificity
Метод класса: Selector{}
Хуков нет.
Возвращает
int.
Использование
$Selector = new Selector(); $Selector->getSpecificity();
Код Selector::getSpecificity() Selector::getSpecificity WC 11.3.0
public function getSpecificity()
{
if ($this->iSpecificity === null) {
$a = 0;
/// @todo should exclude \# as well as "#"
$aMatches = null;
$b = substr_count($this->sSelector, '#');
$c = preg_match_all(self::NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX, $this->sSelector, $aMatches);
$d = preg_match_all(self::ELEMENTS_AND_PSEUDO_ELEMENTS_RX, $this->sSelector, $aMatches);
$this->iSpecificity = ($a * 1000) + ($b * 100) + ($c * 10) + $d;
}
return $this->iSpecificity;
}