class-spec-block-config.php
2 years ago
class-spec-block-helper.php
1 year ago
class-spec-block-js.php
2 years ago
class-spec-block-loader.php
2 years ago
class-spec-filesystem.php
2 months ago
class-spec-gb-helper.php
11 months ago
class-spec-init-blocks.php
5 months ago
class-spec-spectra-compatibility.php
5 months ago
class-spec-block-js.php
80 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Sureforms Block Js. |
| 4 | * |
| 5 | * @package Sureforms |
| 6 | */ |
| 7 | |
| 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | exit; // Exit if accessed directly. |
| 10 | } |
| 11 | |
| 12 | if ( ! class_exists( 'Spec_Block_JS' ) ) { |
| 13 | |
| 14 | /** |
| 15 | * Class Sureforms_Spec_Block_JS. |
| 16 | */ |
| 17 | class Spec_Block_JS { |
| 18 | |
| 19 | /** |
| 20 | * Adds Google fonts for Next Step Button. |
| 21 | * |
| 22 | * @since 0.0.1 |
| 23 | * @param array $attr the blocks attr. |
| 24 | */ |
| 25 | public static function blocks_separator_gfont( $attr ) { |
| 26 | |
| 27 | $element_text_load_google_font = isset( $attr['elementTextLoadGoogleFonts'] ) ? $attr['elementTextLoadGoogleFonts'] : ''; |
| 28 | $element_text_font_family = isset( $attr['elementTextFontFamily'] ) ? $attr['elementTextFontFamily'] : ''; |
| 29 | $element_text_font_weight = isset( $attr['elementTextFontWeight'] ) ? $attr['elementTextFontWeight'] : ''; |
| 30 | |
| 31 | Spec_Gb_Helper::blocks_google_font( $element_text_load_google_font, $element_text_font_family, $element_text_font_weight ); |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Adds Google fonts for Advanced Heading block. |
| 36 | * |
| 37 | * @since 0.0.1 |
| 38 | * @param array $attr the blocks attr. |
| 39 | */ |
| 40 | public static function blocks_advanced_heading_gfont( $attr ) { |
| 41 | |
| 42 | $head_load_google_font = isset( $attr['headLoadGoogleFonts'] ) ? $attr['headLoadGoogleFonts'] : ''; |
| 43 | $head_font_family = isset( $attr['headFontFamily'] ) ? $attr['headFontFamily'] : ''; |
| 44 | $head_font_weight = isset( $attr['headFontWeight'] ) ? $attr['headFontWeight'] : ''; |
| 45 | |
| 46 | $subhead_load_google_font = isset( $attr['subHeadLoadGoogleFonts'] ) ? $attr['subHeadLoadGoogleFonts'] : ''; |
| 47 | $subhead_font_family = isset( $attr['subHeadFontFamily'] ) ? $attr['subHeadFontFamily'] : ''; |
| 48 | $subhead_font_weight = isset( $attr['subHeadFontWeight'] ) ? $attr['subHeadFontWeight'] : ''; |
| 49 | |
| 50 | $highlight_head_load_google_font = isset( $attr['highLightLoadGoogleFonts'] ) ? $attr['highLightLoadGoogleFonts'] : ''; |
| 51 | $highlight_head_font_family = isset( $attr['highLightFontFamily'] ) ? $attr['highLightFontFamily'] : ''; |
| 52 | $highlight_head_font_weight = isset( $attr['highLightFontWeight'] ) ? $attr['highLightFontWeight'] : ''; |
| 53 | |
| 54 | Spec_Gb_Helper::blocks_google_font( $head_load_google_font, $head_font_family, $head_font_weight ); |
| 55 | Spec_Gb_Helper::blocks_google_font( $subhead_load_google_font, $subhead_font_family, $subhead_font_weight ); |
| 56 | Spec_Gb_Helper::blocks_google_font( $highlight_head_load_google_font, $highlight_head_font_family, $highlight_head_font_weight ); |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Adds Google fonts for Advanced Image block. |
| 61 | * |
| 62 | * @since 0.0.1 |
| 63 | * @param array $attr the blocks attr. |
| 64 | */ |
| 65 | public static function blocks_image_gfont( $attr ) { |
| 66 | |
| 67 | $heading_load_google_font = isset( $attr['headingLoadGoogleFonts'] ) ? $attr['headingLoadGoogleFonts'] : ''; |
| 68 | $heading_font_family = isset( $attr['headingFontFamily'] ) ? $attr['headingFontFamily'] : ''; |
| 69 | $heading_font_weight = isset( $attr['headingFontWeight'] ) ? $attr['headingFontWeight'] : ''; |
| 70 | |
| 71 | $caption_load_google_font = isset( $attr['captionLoadGoogleFonts'] ) ? $attr['captionLoadGoogleFonts'] : ''; |
| 72 | $caption_font_family = isset( $attr['captionFontFamily'] ) ? $attr['captionFontFamily'] : ''; |
| 73 | $caption_font_weight = isset( $attr['captionFontWeight'] ) ? $attr['captionFontWeight'] : ''; |
| 74 | |
| 75 | Spec_Gb_Helper::blocks_google_font( $heading_load_google_font, $heading_font_family, $heading_font_weight ); |
| 76 | Spec_Gb_Helper::blocks_google_font( $caption_load_google_font, $caption_font_family, $caption_font_weight ); |
| 77 | } |
| 78 | } |
| 79 | } |
| 80 |