Automattic\WooCommerce\EmailEditor\Integrations\WooCommerce\Renderer\Blocks
Product_Image::extract_image_height
Extract image height from HTML for positioning calculations.
Метод класса: Product_Image{}
Хуков нет.
Возвращает
float. Image height in pixels.
Использование
// private - только в коде основоного (родительского) класса $result = $this->extract_image_height( $image_html ): float;
- $image_html(строка) (обязательный)
- Image HTML.
Код Product_Image::extract_image_height() Product Image::extract image height WC 11.2.2
private function extract_image_height( string $image_html ): float {
$height = ( new Dom_Document_Helper( $image_html ) )->get_attribute_value_by_tag_name( 'img', 'height' ) ?? '';
if ( $height ) {
return Styles_Helper::parse_value( $height );
}
return 300;
}