$overlay_styles = sprintf( 'background-color: %s', $attributes['overlayColor'] ); } else { $overlay_styles = 'background-color: #000000'; } return sprintf( '
', esc_attr( $overlay_styles ) ); } /** * Returns whether the focal point is defined for the block. * * @param array $attributes Block attributes. Default empty array. * * @return bool */ private function hasFocalPoint( $attributes ): bool { return is_array( $attributes['focalPoint'] ) && 2 === count( $attributes['focalPoint'] ); } /** * Extra data passed through from server to client for block. * * @param array $attributes Any attributes that currently are available from the block. * Note, this will be empty in the editor context when the block is * not in the post content on editor load. */ protected function enqueue_data( array $attributes = [] ) { parent::enqueue_data( $attributes ); $this->asset_data_registry->add( 'min_height', wc_get_theme_support( 'featured_block::min_height', 500 ), true ); $this->asset_data_registry->add( 'default_height', wc_get_theme_support( 'featured_block::default_height', 500 ), true ); } }