| @@ -1,6 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | -namespace Easyel\EasyElements\Widgets; | |
| 3 | 2 | use Elementor\Controls_Manager; |
| 4 | 3 | use Elementor\Group_Control_Typography; |
| 5 | 4 | use Elementor\Widget_Base; |
| 6 | 5 | use Elementor\Group_Control_Background; |
| @@ -10,8 +9,18 @@ | ||
| 10 | 9 | } |
| 11 | 10 | |
| 12 | 11 | class Easyel_Heading_Widget extends \Elementor\Widget_Base { |
| 13 | 12 | |
| 13 | + public function get_style_depends() { | |
| 14 | + $handle = 'eel-heading-style'; | |
| 15 | + $css_path = plugin_dir_path( __FILE__ ) . 'css/heading.min.css'; | |
| 16 | + | |
| 17 | + if ( ! wp_style_is( $handle, 'registered' ) && file_exists( $css_path ) ) { | |
| 18 | + wp_register_style( $handle, plugins_url( 'css/heading.min.css', __FILE__ ), [], defined( 'WP_DEBUG' ) && WP_DEBUG ? filemtime( $css_path ) : '1.0.0' ); | |
| 19 | + } | |
| 20 | + return [ $handle ]; | |
| 21 | + } | |
| 22 | + | |
| 14 | 23 | public function get_name() { |
| 15 | 24 | return 'eel-heading'; |
| 16 | 25 | } |
| 17 | 26 | |
| @@ -29,15 +38,8 @@ | ||
| 29 | 38 | public function get_keywords() { |
| 30 | 39 | return [ 'heading', 'title', 'link', 'click', 'text' ]; |
| 31 | 40 | } |
| 32 | 41 | |
| 33 | - public function get_style_depends() { | |
| 34 | - return [ | |
| 35 | - 'eel-heading', | |
| 36 | - ]; | |
| 37 | - } | |
| 38 | - | |
| 39 | - | |
| 40 | 42 | protected function register_controls() { |
| 41 | 43 | $this->start_controls_section( |
| 42 | 44 | 'content_section', |
| 43 | 45 | [ |
| @@ -1282,5 +1284,6 @@ | ||
| 1282 | 1284 | |
| 1283 | 1285 | ?> |
| 1284 | 1286 | </div> |
| 1285 | 1287 | <?php } |
| 1286 | -} | |
| 1288 | +} | |
| 1289 | +?> | |