field['default'][ $property ] ) ) { continue; } // Early exit if the value is not saved in the values. if ( ! isset( $value[ $property ] ) || ! $value[ $property ] ) { continue; } // Early exit if we use "choice" but not for this property. if ( isset( $output['choice'] ) && $output['choice'] !== $property ) { continue; } // Take care of variants. if ( 'variant' === $property && isset( $value['variant'] ) && ! empty( $value['variant'] ) ) { // Get the font_weight. $font_weight = str_replace( 'italic', '', $value['variant'] ); $font_weight = ( in_array( $font_weight, array( '', 'regular' ), true ) ) ? '400' : $font_weight; // Is this italic? $is_italic = ( false !== strpos( $value['variant'], 'italic' ) ); $this->styles[ $output['media_query'] ][ $output['element'] ]['font-weight'] = $font_weight; if ( $is_italic ) { $this->styles[ $output['media_query'] ][ $output['element'] ]['font-style'] = 'italic'; } continue; } $property_value = $this->process_property_value( $property, $value[ $property ] ); if ( 'font-family' === $property ) { $value['font-backup'] = ( isset( $value['font-backup'] ) ) ? $value['font-backup'] : ''; $property_value = $this->process_property_value( $property, array( $value['font-family'], $value['font-backup'], ) ); } $property = ( isset( $output['choice'] ) && isset( $output['property'] ) ) ? $output['property'] : $property; $property_value = ( is_array( $property_value ) && isset( $property_value[0] ) ) ? $property_value[0] : $property_value; $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $property_value . $output['suffix']; } } }