WP_Styles::add_inline_style()publicWP 3.3.0

Adds extra CSS styles to a registered stylesheet.

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

Хуков нет.

Возвращает

true|false. True on success, false on failure.

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

global $wp_styles;
$wp_styles->add_inline_style( $handle, $code );
$handle(строка) (обязательный)
The style's registered handle.
$code(строка) (обязательный)
String containing the CSS styles to be added.

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

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

Код WP_Styles::add_inline_style() WP 6.4.3

public function add_inline_style( $handle, $code ) {
	if ( ! $code ) {
		return false;
	}

	$after = $this->get_data( $handle, 'after' );
	if ( ! $after ) {
		$after = array();
	}

	$after[] = $code;

	return $this->add_data( $handle, 'after', $after );
}