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

Quote::get_citation_wrapperprivateWC 1.0

Returns the citation content with a wrapper.

Method of the class: Quote{}

No Hooks.

Returns

String. The wrapped citation HTML or empty string if no citation.

Usage

// private - for code of main (parent) class only
$result = $this->get_citation_wrapper( $citation_content, $parsed_block ): string;
$citation_content(string) (required)
The citation text.
$parsed_block(array) (required)
Parsed block.

Quote::get_citation_wrapper() code WC 9.9.5

private function get_citation_wrapper( string $citation_content, array $parsed_block ): string {
	if ( empty( $citation_content ) ) {
		return '';
	}

	return $this->add_spacer(
		sprintf(
			'<p style="margin: 0; %2$s"><cite class="email-block-quote-citation" style="display: block; margin: 0;">%1$s</cite></p>',
			$citation_content,
			WP_Style_Engine::compile_css( array( 'text-align' => $parsed_block['attrs']['textAlign'] ?? '' ), '' ),
		),
		$parsed_block['email_attrs'] ?? array()
	);
}