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

Fallback{}WC 1.0└─ Abstract_Block_Renderer

Fallback block renderer. This renderer is used when no specific renderer is found for a block.

AbstractBlockRenderer applies some adjustments to the block content, like adding spacers. By using fallback renderer for all blocks we apply there adjustments to all blocks that don't have any renderer.

We need to find a better abstraction/architecture for this.

Хуков нет.

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

$Fallback = new Fallback();
// use class methods

Методы

  1. protected render_content( $block_content, array $parsed_block, Settings_Controller $settings_controller )

Код Fallback{} WC 9.9.5

class Fallback extends Abstract_Block_Renderer {
	/**
	 * Renders the block content.
	 *
	 * @param string              $block_content Block content.
	 * @param array               $parsed_block Parsed block.
	 * @param Settings_Controller $settings_controller Settings controller.
	 * @return string
	 */
	protected function render_content( $block_content, array $parsed_block, Settings_Controller $settings_controller ): string {
		return $block_content;
	}
}