Automattic\WooCommerce\Vendor\Sabberworm\CSS
OutputFormat::set
Deprecated since 8.8.0. It is no longer supported and may be removed in future releases. Use
specific setters instead.Method of the class: OutputFormat{}
No Hooks.
Returns
self|false.
Usage
$OutputFormat = new OutputFormat(); $OutputFormat->set( $aNames, $mValue );
- $aNames(required)
- .
- $mValue(mixed) (required)
- .
Changelog
| Deprecated | Since 8.8.0 | , will be removed in 9.0.0. Use specific setters instead. |
OutputFormat::set() OutputFormat::set code WC 10.5.0
public function set($aNames, $mValue)
{
$aVarPrefixes = ['a', 's', 'm', 'b', 'f', 'o', 'c', 'i'];
if (is_string($aNames) && strpos($aNames, '*') !== false) {
$aNames =
[
str_replace('*', 'Before', $aNames),
str_replace('*', 'Between', $aNames),
str_replace('*', 'After', $aNames),
];
} elseif (!is_array($aNames)) {
$aNames = [$aNames];
}
foreach ($aVarPrefixes as $sPrefix) {
$bDidReplace = false;
foreach ($aNames as $sName) {
$sFieldName = $sPrefix . ucfirst($sName);
if (isset($this->$sFieldName)) {
$this->$sFieldName = $mValue;
$bDidReplace = true;
}
}
if ($bDidReplace) {
return $this;
}
}
// Break the chain so the user knows this option is invalid
return false;
}