astra_responsive_font( array $font, string $device = 'desktop', string $default = '' )

Get Font CSS value


Description


Parameters

$font

(array) (Required) CSS value.

$device

(string) (Optional) CSS device.

Default value: 'desktop'

$default

(string) (Optional) Default value.

Default value: ''


Return

(mixed)


Source

File: classes/astra-common-functions.php

	function astra_responsive_font( $font, $device = 'desktop', $default = '' ) {
		$css_val = '';

		if ( isset( $font[ $device ] ) && isset( $font[ $device . '-unit' ] ) ) {
			if ( '' != $default ) {
				$font_size = astra_get_css_value( $font[ $device ], $font[ $device . '-unit' ], $default );
			} else {
				$font_size = astra_get_font_css_value( $font[ $device ], $font[ $device . '-unit' ] );
			}
		} elseif ( is_numeric( $font ) ) {
			$font_size = astra_get_css_value( $font );
		} else {
			$font_size = ( ! is_array( $font ) ) ? $font : '';
		}

		return $font_size;
	}


User Contributed Notes

You must log in before being able to contribute a note or feedback.