Automattic\WooCommerce\EmailEditorVendor\Pelago\Emogrifier
CssInliner::removeSelectorComponents
Removes components from a CSS selector, replacing them with "*" if necessary.
Метод класса: CssInliner{}
Хуков нет.
Возвращает
string. selector which will match the relevant DOM elements if the removed components are assumed to apply (or in the case of pseudo-elements will match their originating element)
Использование
// private - только в коде основоного (родительского) класса $result = $this->removeSelectorComponents( $matcher, $selector ): string;
- $matcher(строка) (обязательный)
- regular expression part to match the components to remove.
- $selector(строка) (обязательный)
- .
Код CssInliner::removeSelectorComponents() CssInliner::removeSelectorComponents WC 11.3.0
private function removeSelectorComponents(string $matcher, string $selector): string
{
return (new Preg())->throwExceptions($this->debug)->replace(
['/([\\s>+~]|^)' . $matcher . '/i', '/' . $matcher . '/i'],
['$1*', ''],
$selector
);
}