Automattic\WooCommerce\EmailEditor\Integrations\Core\Renderer\Blocks

Cover::build_cover_content │ private │ WC 1.0

Build the cover content with background image or color.

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

Хуков нет.

Возвращает

string. Cover content HTML.

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

// private - только в коде основоного (родительского) класса
$result = $this->build_cover_content( $inner_content ): string;
$inner_content(строка) (обязательный)
Inner content.

Код Cover::build_cover_content() WC 11.2.2

private function build_cover_content( string $inner_content ): string {
	$cover_style = 'position: relative; display: inline-block; width: 100%; max-width: 100%;';

	// Wrap inner content with padding.
	// Note: $inner_content is already rendered HTML from other blocks via render_block(),
	// so it should be properly escaped by the individual block renderers.
	$inner_wrapper_style = 'padding: 20px;';
	$inner_wrapper_html  = sprintf(
		'<div class="wp-block-cover__inner-container" style="%s">%s</div>',
		$inner_wrapper_style,
		$inner_content
	);

	return sprintf(
		'<div class="wp-block-cover" style="%s">%s</div>',
		$cover_style,
		$inner_wrapper_html
	);
}