Automattic\WooCommerce\Vendor\Sabberworm\CSS\RuleSet
RuleSet::removeRule
Removes a Rule from this RuleSet by identity.
Method of the class: RuleSet{}
No Hooks.
Returns
null. Nothing (null).
Usage
$RuleSet = new RuleSet(); $RuleSet->removeRule( $mRule );
- $mRule(Rule|string|null) (required)
Ruleto remove. Passing astringornullis deprecated in version 8.9.0, and will no longer work from v9.0. UseremoveMatchingRules()orremoveAllRules()instead.
RuleSet::removeRule() RuleSet::removeRule code WC 10.8.1
public function removeRule($mRule)
{
if ($mRule instanceof Rule) {
$sRule = $mRule->getRule();
if (!isset($this->aRules[$sRule])) {
return;
}
foreach ($this->aRules[$sRule] as $iKey => $oRule) {
if ($oRule === $mRule) {
unset($this->aRules[$sRule][$iKey]);
}
}
} elseif ($mRule !== null) {
$this->removeMatchingRules($mRule);
} else {
$this->removeAllRules();
}
}