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

Abstract_Block_Renderer::add_spacer_with_context │ protected │ WC 1.0

Add a spacer around the block with rendering context.

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

Хуков нет.

Возвращает

string.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->add_spacer_with_context( $content, $email_attrs, ?Rendering_Context $rendering_context ): string;
$content(строка) (обязательный)
The block content.
$email_attrs(массив) (обязательный)
The email attributes.
?Rendering_Context $rendering_context
.
По умолчанию: null

Код Abstract_Block_Renderer::add_spacer_with_context() WC 11.3.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;
	}
}