Automattic\WooCommerce\EmailEditorVendor\Sabberworm\CSS
OutputFormat::set
Устарела с версии 8.8.0. Больше не поддерживается и может быть удалена. Используйте
specific setters.Метод класса: OutputFormat{}
Хуков нет.
Возвращает
self|false.
Использование
$OutputFormat = new OutputFormat(); $OutputFormat->set( $aNames, $mValue );
- $aNames(array<array-key, string>|строка) (обязательный)
- .
- $mValue(разное) (обязательный)
- .
Список изменений
| Устарела | С версии 8.8.0 | , will be removed in 9.0.0. Use specific setters instead. |
Код OutputFormat::set() OutputFormat::set WC 11.3.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;
}