PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.0.5
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.0.5
3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 All 111 releases
templately / includes / Builder / Types / Header.php

Header.php in Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! 3.0.5, at includes/Builder/Types/Header.php

50 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Templately\Builder\Types;
4
5 use Templately\Core\Importer\FullSiteImport;
6
7 class Header extends HeaderFooterBase {
8 public static function get_type(): string {
9 return 'header';
10 }
11
12 public static function get_title(): string {
13 return __( 'Header', 'templately' );
14 }
15
16 public static function get_plural_title(): string {
17 return __( 'Headers', 'templately' );
18 }
19
20 public static function get_properties(): array {
21 $properties = parent::get_properties();
22
23 $properties['location'] = 'header';
24
25 return $properties;
26 }
27
28 public function import( $elementor_data ) {
29 if ( $this->is_elementor_template() ) {
30 $request = FullSiteImport::get_instance()->get_session_data();
31
32 $elementor_data['content'] = \Elementor\Plugin::$instance->db->iterate_data($elementor_data['content'], function($element) use ($request){
33 // check if it's a image widget
34 if( $element['elType'] == 'widget' && $element['widgetType'] == 'image' ) {
35 // check if it has a image source
36 if( isset($request['logo']['url']) ) {
37 // set the image url
38 $element['settings']['image']['id'] = $request['logo']['id'];
39 $element['settings']['image']['url'] = $request['logo']['url'];
40 }
41 }
42
43 return $element;
44 });
45
46
47 }
48 parent::import( $elementor_data );
49 }
50 }