Automattic\WooCommerce\Vendor\Sabberworm\CSS\RuleSet
RuleSet::removeMatchingRules
Removes rules by property name or search pattern.
Метод класса: RuleSet{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$RuleSet = new RuleSet(); $RuleSet->removeMatchingRules( $searchPattern );
- $searchPattern(строка) (обязательный)
- pattern to remove. If the pattern ends in a dash, all rules starting with the pattern are removed as well as one matching the pattern with the dash excluded.
Код RuleSet::removeMatchingRules() RuleSet::removeMatchingRules WC 11.0.1
public function removeMatchingRules($searchPattern)
{
foreach ($this->aRules as $propertyName => $rules) {
// Either the search rule matches the found rule exactly
// or the search rule ends in “-” and the found rule starts with the search rule or equals it
// (without the trailing dash).
if (
$propertyName === $searchPattern
|| (\strrpos($searchPattern, '-') === \strlen($searchPattern) - \strlen('-')
&& (\strpos($propertyName, $searchPattern) === 0
|| $propertyName === \substr($searchPattern, 0, -1)))
) {
unset($this->aRules[$propertyName]);
}
}
}