Automattic\WooCommerce\Vendor\Sabberworm\CSS\CSSList
CSSBlockList::getAllValues
Returns all Value objects found recursively in Rules in the tree.
Method of the class: CSSBlockList{}
No Hooks.
Returns
Array
Usage
$CSSBlockList = new CSSBlockList(); $CSSBlockList->getAllValues( $element, $ruleSearchPatternOrSearchInFunctionArguments, $searchInFunctionArguments );
- $element(CSSElement|string|null)
- This is the
CSSListorRuleSetto start the search from (defaults to the whole document). If a string is given, it is used as a rule name filter. Passing a string for this parameter is deprecated in version 8.9.0, and will not work from v9.0; use the following parameter to pass a rule name filter instead.
Default:null - $ruleSearchPatternOrSearchInFunctionArguments(string|true|false|null)
- This allows filtering rules by property name (e.g. if "color" is passed, only
Values fromcolorproperties will be returned, or if "font-" is provided,Values from all font rules, likefont-size, and includingfontitself, will be returned). If a Boolean is provided, it is treated as the$searchInFunctionArgumentsargument. Passing a Boolean for this parameter is deprecated in version 8.9.0, and will not work from v9.0; use the$searchInFunctionArgumentsparameter instead.
Default:null - $searchInFunctionArguments(true|false)
- whether to also return Value objects used as Function arguments.
Default:false
Notes
- See: RuleSet->getRules()
CSSBlockList::getAllValues() CSSBlockList::getAllValues code WC 10.4.3
public function getAllValues(
$element = null,
$ruleSearchPatternOrSearchInFunctionArguments = null,
$searchInFunctionArguments = false
) {
if (\is_bool($ruleSearchPatternOrSearchInFunctionArguments)) {
$searchInFunctionArguments = $ruleSearchPatternOrSearchInFunctionArguments;
$searchString = null;
} else {
$searchString = $ruleSearchPatternOrSearchInFunctionArguments;
}
if ($element === null) {
$element = $this;
} elseif (\is_string($element)) {
$searchString = $element;
$element = $this;
}
$result = [];
$this->allValues($element, $result, $searchString, $searchInFunctionArguments);
return $result;
}