diff --git a/plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php b/plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php index 4791b845cf..8d35084e19 100644 --- a/plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php +++ b/plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php @@ -44,6 +44,18 @@ public function __invoke( OD_Tag_Visitor_Context $context ): bool { return false; } + $minimum_height = $context->url_metrics_group_collection->get_element_minimum_height( $processor->get_xpath() ); + if ( is_int( $minimum_height ) ) { + $style = $processor->get_attribute( 'style' ); + if ( is_string( $style ) ) { + $style = rtrim( trim( $style ), ';' ) . '; '; + } else { + $style = ''; + } + $style .= sprintf( 'min-height: %dpx;', $minimum_height ); + $processor->set_attribute( 'style', $style ); + } + $max_intersection_ratio = $context->url_metrics_group_collection->get_element_max_intersection_ratio( $processor->get_xpath() ); if ( $max_intersection_ratio > 0 ) { diff --git a/plugins/embed-optimizer/tests/test-optimization-detective.php b/plugins/embed-optimizer/tests/test-optimization-detective.php index cad101ad71..47e8e53237 100644 --- a/plugins/embed-optimizer/tests/test-optimization-detective.php +++ b/plugins/embed-optimizer/tests/test-optimization-detective.php @@ -74,7 +74,7 @@ public function data_provider_test_od_optimize_template_output_buffer(): array {
-