PluginProbe
Elementor Website Builder – more than just a page builder / 3.30.0-dev3
Elementor Website Builder – more than just a page builder v3.30.0-dev3
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / modules / variables / classes / fonts.php

fonts.php in Elementor Website Builder – more than just a page builder 3.30.0-dev3, at modules/variables/classes/fonts.php

38 lines 807 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Modules\Variables\Classes;
4
5 use Elementor\Plugin;
6 use Elementor\Core\Files\CSS\Post as Post_CSS;
7 use Elementor\Modules\Variables\PropTypes\Font_Variable_Prop_Type;
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly.
11 }
12
13 class Fonts {
14 public function append_to( Post_CSS $post_css ) {
15 if ( ! Plugin::$instance->kits_manager->is_kit( $post_css->get_post_id() ) ) {
16 return;
17 }
18
19 $list_of_variables = ( new Variables() )->get_all();
20
21 foreach ( $list_of_variables as $variable ) {
22 if ( Font_Variable_Prop_Type::get_key() !== $variable['type'] ) {
23 continue;
24 }
25
26 $font_family = sanitize_text_field( $variable['value'] ?? '' );
27
28 if ( empty( $font_family ) ) {
29 continue;
30 }
31
32 $post_css->add_font( $font_family );
33 }
34
35 return $this;
36 }
37 }
38