0,
'height' => 0,
);
$logo_style = '';
if ( $logo_type == 'image' && $logo_id ) {
$logo_meta = get_post_meta( $logo_id, '_wp_attachment_metadata', true );
$size_coefficient = get_post_mime_type( $logo_id ) === 'image/svg+xml' ? 1 : 2;
$logo_size = array(
'width' => isset( $logo_meta['width'] ) ? intval( $logo_meta['width'] ) / $size_coefficient : 0,
'height' => isset( $logo_meta['height'] ) ? intval( $logo_meta['height'] ) / $size_coefficient : 0,
);
if ( ! empty( $logo_size['height'] ) ) {
$logo_style = "max-height: {$logo_size['height']}px;";
}
}
?>