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

Abstract_Block_Renderer::add_spacer_with_contextprotectedWC 1.0

Add a spacer around the block with rendering context.

Method of the class: Abstract_Block_Renderer{}

No Hooks.

Returns

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->add_spacer_with_context( $content, $email_attrs, ?Rendering_Context $rendering_context ): string;
$content(string) (required)
The block content.
$email_attrs(array) (required)
The email attributes.
?Rendering_Context $rendering_context
.
Default: null

Abstract_Block_Renderer::add_spacer_with_context() code WC 11.0.0

protected function add_spacer_with_context( $content, $email_attrs, ?Rendering_Context $rendering_context = null ): string {
	$previous_context                = $this->current_rendering_context;
	$this->current_rendering_context = $rendering_context;

	try {
		return $this->add_spacer( $content, $email_attrs );
	} finally {
		$this->current_rendering_context = $previous_context;
	}
}