wp_apply_dimensions_support() – Adds CSS classes for block dimensions to the incoming attributes array.
You appear to be a bot. Output may be restricted
Description
Adds CSS classes for block dimensions to the incoming attributes array.
This will be applied to the block markup in the front-end.
Usage
$array = wp_apply_dimensions_support( $block_type, $block_attributes );
Parameters
- $block_type
- ( WP_Block_Type ) required – Block Type.
- $block_attributes
- ( array ) required – Block attributes.
Returns
array Block dimensions CSS classes and inline styles.
Source
File name: wordpress/wp-includes/block-supports/dimensions.php
Lines:
1 to 13 of 13
function wp_apply_dimensions_support( $block_type, $block_attributes ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable if ( wp_should_skip_block_supports_serialization( $block_type, '__experimentalDimensions' ) ) { return array(); } $styles = array(); // Height support to be added in near future. // Width support to be added in near future. return empty( $styles ) ? array() : array( 'style' => implode( ' ', $styles ) ); }