Automattic\WooCommerce\Blocks\BlockTypes\ProductCollection

Renderer::handle_block_dimensionsprivateWC 1.0

Handle block dimensions if width type is set to 'fixed'.

Method of the class: Renderer{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->handle_block_dimensions( $p, $block );
$p(WP_HTML_Tag_Processor) (required)
The HTML tag processor.
$block(array) (required)
The block details.

Renderer::handle_block_dimensions() code WC 10.3.6

private function handle_block_dimensions( $p, $block ) {
	if ( isset( $block['attrs']['dimensions'] ) && isset( $block['attrs']['dimensions']['widthType'] ) ) {
		if ( 'fixed' === $block['attrs']['dimensions']['widthType'] ) {
			$this->set_fixed_width_style( $p, $block['attrs']['dimensions']['fixedWidth'] );
		}
	}
}