Addon_Gutenberg_Editor_CSS::typography_addon_gutenberg_dynamic_css( string $dynamic_css, string $dynamic_css_filtered = '' )

Dynamic CSS – Typography


Description


Parameters

$dynamic_css

(string) (Required) Astra Gutenberg Dynamic CSS.

$dynamic_css_filtered

(string) (Optional) Astra Gutenberg Dynamic CSS Filters.

Default value: ''


Return

(string)


Source

File: classes/class-addon-gutenberg-editor-css.php

		public function typography_addon_gutenberg_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {
			$h1_font_family    = astra_get_option( 'font-family-h1' );
			$h1_font_weight    = astra_get_option( 'font-weight-h1' );
			$h1_line_height    = astra_get_option( 'line-height-h1' );
			$h1_text_transform = astra_get_option( 'text-transform-h1' );

			$h2_font_family    = astra_get_option( 'font-family-h2' );
			$h2_font_weight    = astra_get_option( 'font-weight-h2' );
			$h2_line_height    = astra_get_option( 'line-height-h2' );
			$h2_text_transform = astra_get_option( 'text-transform-h2' );

			$h3_font_family    = astra_get_option( 'font-family-h3' );
			$h3_font_weight    = astra_get_option( 'font-weight-h3' );
			$h3_line_height    = astra_get_option( 'line-height-h3' );
			$h3_text_transform = astra_get_option( 'text-transform-h3' );

			$h4_font_family    = astra_get_option( 'font-family-h4' );
			$h4_font_weight    = astra_get_option( 'font-weight-h4' );
			$h4_line_height    = astra_get_option( 'line-height-h4' );
			$h4_text_transform = astra_get_option( 'text-transform-h4' );

			$h5_font_family    = astra_get_option( 'font-family-h5' );
			$h5_font_weight    = astra_get_option( 'font-weight-h5' );
			$h5_line_height    = astra_get_option( 'line-height-h5' );
			$h5_text_transform = astra_get_option( 'text-transform-h5' );

			$h6_font_family    = astra_get_option( 'font-family-h6' );
			$h6_font_weight    = astra_get_option( 'font-weight-h6' );
			$h6_line_height    = astra_get_option( 'line-height-h6' );
			$h6_text_transform = astra_get_option( 'text-transform-h6' );

			$parse_css = '';
			/**
			 * Typography
			 */
			$typography_css_output = array(
				/**
				 * Heading - <h1>
				 */
				'.edit-post-visual-editor h1, .wp-block-heading h1.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h1, .edit-post-visual-editor h1.block-editor-block-list__block' => array(
					'font-weight'    => astra_get_css_value( $h1_font_weight, 'font' ),
					'font-family'    => astra_get_css_value( $h1_font_family, 'font' ),
					'line-height'    => esc_attr( $h1_line_height ),
					'text-transform' => esc_attr( $h1_text_transform ),
				),

				/**
				 * Heading - <h2>
				 */
				'.edit-post-visual-editor h2, .wp-block-heading h2.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h2, .edit-post-visual-editor h2.block-editor-block-list__block' => array(
					'font-weight'    => astra_get_css_value( $h2_font_weight, 'font' ),
					'font-family'    => astra_get_css_value( $h2_font_family, 'font' ),
					'line-height'    => esc_attr( $h2_line_height ),
					'text-transform' => esc_attr( $h2_text_transform ),
				),

				/**
				 * Heading - <h3>
				 */
				'.edit-post-visual-editor h3, .wp-block-heading h3.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h3, .edit-post-visual-editor h3.block-editor-block-list__block' => array(
					'font-weight'    => astra_get_css_value( $h3_font_weight, 'font' ),
					'font-family'    => astra_get_css_value( $h3_font_family, 'font' ),
					'line-height'    => esc_attr( $h3_line_height ),
					'text-transform' => esc_attr( $h3_text_transform ),
				),

				/**
				 * Heading - <h4>
				 */
				'.edit-post-visual-editor h4, .wp-block-heading h4.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h4, .edit-post-visual-editor h4.block-editor-block-list__block' => array(
					'font-weight'    => astra_get_css_value( $h4_font_weight, 'font' ),
					'font-family'    => astra_get_css_value( $h4_font_family, 'font' ),
					'line-height'    => esc_attr( $h4_line_height ),
					'text-transform' => esc_attr( $h4_text_transform ),
				),

				/**
				 * Heading - <h5>
				 */
				'.edit-post-visual-editor h5, .wp-block-heading h5.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h5, .edit-post-visual-editor h5.block-editor-block-list__block' => array(
					'font-weight'    => astra_get_css_value( $h5_font_weight, 'font' ),
					'font-family'    => astra_get_css_value( $h5_font_family, 'font' ),
					'line-height'    => esc_attr( $h5_line_height ),
					'text-transform' => esc_attr( $h5_text_transform ),
				),

				/**
				 * Heading - <h6>
				 */
				'.edit-post-visual-editor h6, .wp-block-heading h6.editor-rich-text__tinymce, .editor-styles-wrapper .wp-block-uagb-advanced-heading h6, .edit-post-visual-editor h6.block-editor-block-list__block' => array(
					'font-weight'    => astra_get_css_value( $h6_font_weight, 'font' ),
					'font-family'    => astra_get_css_value( $h6_font_family, 'font' ),
					'line-height'    => esc_attr( $h6_line_height ),
					'text-transform' => esc_attr( $h6_text_transform ),
				),
			);
			$parse_css .= astra_parse_css( $typography_css_output );

			return $dynamic_css . $parse_css;
		}

Changelog

Changelog
Version Description
1.6.2 Introduced.

User Contributed Notes

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