Automattic\WooCommerce\EmailEditor\Engine\Renderer\ContentRenderer\Preprocessors
Spacing_Preprocessor::has_explicit_horizontal_padding
Checks whether a block explicitly defines any horizontal padding.
Containers with explicit padding (any value) manage their own layout and should stop delegating root padding to their children.
Method of the class: Spacing_Preprocessor{}
No Hooks.
Returns
true|false. True if the block defines horizontal padding.
Usage
// private - for code of main (parent) class only $result = $this->has_explicit_horizontal_padding( $block ): bool;
- $block(array) (required)
- The block to check.
Spacing_Preprocessor::has_explicit_horizontal_padding() Spacing Preprocessor::has explicit horizontal padding code WC 10.8.1
private function has_explicit_horizontal_padding( array $block ): bool {
$padding = $block['attrs']['style']['spacing']['padding'] ?? array();
return isset( $padding['left'] ) || isset( $padding['right'] );
}