wp_add_state_style_group() │ WP 7.1.0

Adds a style fragment to a selector-keyed state style group.

Хуков нет.

Возвращает

null. Ничего (null).

Использование

wp_add_state_style_group( $groups, $selector, $style );
$groups(массив) (обязательный) (передается по ссылке — &)
Selector-keyed style groups.
$selector(строка|null) (обязательный)
Block or feature selector.
$style(массив) (обязательный)
Style fragment.

Список изменений

С версии 7.1.0 Введена.

Код wp_add_state_style_group() WP 7.1.3

function wp_add_state_style_group( &$groups, $selector, $style ) {
	$key = is_string( $selector ) ? $selector : '';

	if ( ! isset( $groups[ $key ] ) ) {
		$groups[ $key ] = array(
			'selector' => $selector,
			'style'    => array(),
		);
	}

	$groups[ $key ]['style'] = array_replace_recursive( $groups[ $key ]['style'], $style );
}