WP_Style_Engine::store_css_rule
Stores a CSS rule using the provided CSS selector and CSS declarations.
Метод класса: WP_Style_Engine{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$result = WP_Style_Engine::store_css_rule( $store_name, $css_selector, $css_declarations, $rules_group );
- $store_name(строка) (обязательный)
- A valid store key.
- $css_selector(строка) (обязательный)
- When a selector is passed, the function will return a full CSS rule
$selector { ...rules }otherwise a concatenated string of properties and values. - $css_declarations(string[]|WP_Style_Engine_CSS_Declarations) (обязательный)
- An associative array of CSS definitions, e.g.
array( "$property" => "$value", "$property" => "$value" ), or a WP_Style_Engine_CSS_Declarations object. - $rules_group(строка)
- A parent CSS selector in the case of nested CSS, or a CSS nested @rule, such as
@media (min-width: 80rem)or@layer module.
По умолчанию:''
Список изменений
| С версии 6.1.0 | Введена. |
| С версии 6.6.0 | Added the $rules_group parameter. |
| С версии 7.1.0 | Extended $css_declarations parameter to accept WP_Style_Engine_CSS_Declarations object. |
Код WP_Style_Engine::store_css_rule() WP Style Engine::store css rule WP 7.1.2
public static function store_css_rule( $store_name, $css_selector, $css_declarations, $rules_group = '' ) {
if ( empty( $store_name ) || empty( $css_selector ) || empty( $css_declarations ) ) {
return;
}
static::get_store( $store_name )->add_rule( $css_selector, $rules_group )->add_declarations( $css_declarations );
}