wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_apply_dimensions_support › WordPress Function

Since5.9.0
Deprecatedn/a
wp_apply_dimensions_support ( $block_type, $block_attributes )
Access:
  • private
Parameters: (2)
  • (WP_Block_Type) $block_type Block Type.
    Required: Yes
  • (array) $block_attributes Block attributes.
    Required: Yes
Returns:
  • (array) Block dimensions CSS classes and inline styles.
Defined at:
Codex:

Add CSS classes for block dimensions to the incoming attributes array.

This will be applied to the block markup in the front-end.


Source

function wp_apply_dimensions_support( $block_type, $block_attributes ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
	if ( wp_skip_dimensions_serialization( $block_type ) ) {
		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 ) );
}