WP_Theme_JSON::get_custom_csspublicWP 6.2.0

Устарела с версии 6.7.0. Больше не поддерживается и может быть удалена. Смотрите get_stylesheet.

Returns the global styles custom CSS.

Метод класса: WP_Theme_JSON{}

Хуков нет.

Возвращает

Строку. The global styles custom CSS.

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

$WP_Theme_JSON = new WP_Theme_JSON();
$WP_Theme_JSON->get_custom_css();

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

С версии 6.2.0 Введена.
Устарела с 6.7.0 Use {@see 'get_stylesheet'} instead.

Код WP_Theme_JSON::get_custom_css() WP 7.0

public function get_custom_css() {
	_deprecated_function( __METHOD__, '6.7.0', 'get_stylesheet' );
	// Add the global styles root CSS.
	$stylesheet = $this->theme_json['styles']['css'] ?? '';

	// Add the global styles block CSS.
	if ( isset( $this->theme_json['styles']['blocks'] ) ) {
		foreach ( $this->theme_json['styles']['blocks'] as $name => $node ) {
			$custom_block_css = $this->theme_json['styles']['blocks'][ $name ]['css'] ?? null;
			if ( $custom_block_css ) {
				$selector    = static::$blocks_metadata[ $name ]['selector'];
				$stylesheet .= $this->process_blocks_custom_css( $custom_block_css, $selector );
			}
		}
	}

	return $stylesheet;
}