PluginProbe
Elementor Website Builder – more than just a page builder / 3.0.6
Elementor Website Builder – more than just a page builder v3.0.6
4.3.0-beta3 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 All 452 releases
← All changes | core/files/css/base.php +8 -16 3.0.53.0.6 View file →
@@ -102,22 +102,8 @@
102 102 return false;
103 103 }
104 104
105 105 /**
106 - * CSS file constructor.
107 - *
108 - * Initializing Elementor CSS file.
109 - *
110 - * @since 1.2.0
111 - * @access public
112 - */
113 - public function __construct( $file_name ) {
114 - parent::__construct( $file_name );
115 -
116 - $this->init_stylesheet();
117 - }
118 -
119 - /**
120 106 * Use external file.
121 107 *
122 108 * Whether to use external CSS file of not. When there are new schemes or settings
123 109 * updates.
@@ -328,8 +314,10 @@
328 314 return;
329 315 }
330 316 }
331 317
318 + $stylesheet = $this->get_stylesheet();
319 +
332 320 foreach ( $control['selectors'] as $selector => $css_property ) {
333 321 $output_css_property = '';
334 322
335 323 if ( $global_key ) {
@@ -421,9 +409,9 @@
421 409 unset( $query['max'] );
422 410 }
423 411 }
424 412
425 - $this->stylesheet_obj->add_rules( $parsed_selector, $output_css_property, $query );
413 + $stylesheet->add_rules( $parsed_selector, $output_css_property, $query );
426 414 }
427 415 }
428 416
429 417 /**
@@ -477,8 +465,12 @@
477 465 *
478 466 * @return Stylesheet The stylesheet object.
479 467 */
480 468 public function get_stylesheet() {
469 + if ( ! $this->stylesheet_obj ) {
470 + $this->init_stylesheet();
471 + }
472 +
481 473 return $this->stylesheet_obj;
482 474 }
483 475
484 476 /**
@@ -638,9 +630,9 @@
638 630 * @param Base $this The current CSS file.
639 631 */
640 632 do_action( "elementor/css-file/{$name}/parse", $this );
641 633
642 - return $this->stylesheet_obj->__toString();
634 + return $this->get_stylesheet()->__toString();
643 635 }
644 636
645 637 /**
646 638 * Add control style rules.