PluginProbe
Elementor Website Builder – more than just a page builder / 3.4.0
Elementor Website Builder – more than just a page builder v3.4.0
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 / core / page-assets / data-managers / widgets-css.php

widgets-css.php in Elementor Website Builder – more than just a page builder 3.4.0, at core/page-assets/data-managers/widgets-css.php

38 lines 896 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Core\Page_Assets\Data_Managers;
3
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit; // Exit if accessed directly.
6 }
7
8 /**
9 * Elementor Assets Data.
10 *
11 * @since 3.3.0
12 */
13 class Widgets_Css extends Base {
14 protected $content_type = 'css';
15
16 protected $assets_category = 'widgets';
17
18 protected function get_asset_content() {
19 $asset_css_file_size = $this->get_file_data( 'size' );
20
21 $widget_css = '';
22
23 if ( $asset_css_file_size ) {
24 // If the file size is larger than 8KB then calling the external CSS file, otherwise, printing inline CSS.
25 if ( $asset_css_file_size > 8000 ) {
26 $asset_url = $this->get_config_data( 'file_url' );
27
28 $widget_css = sprintf( '<link rel="stylesheet" href="%s">', $asset_url );
29 } else {
30 $widget_css = $this->get_file_data( 'content' );
31 $widget_css = sprintf( '<style>%s</style>', $widget_css );
32 }
33 }
34
35 return $widget_css;
36 }
37 }
38