← All changes
|
modules/atomic-widgets/elements/base/has-element-template.php
+3
-22
4.3.0-beta3
→
4.0.9
View file →
| @@ -17,16 +17,8 @@ | ||
| 17 | 17 | * @mixin Atomic_Element_Base |
| 18 | 18 | */ |
| 19 | 19 | trait Has_Element_Template { |
| 20 | 20 | |
| 21 | - private static function get_macros_template_key(): string { | |
| 22 | - return 'elementor/macros'; | |
| 23 | - } | |
| 24 | - | |
| 25 | - protected function transform_link_for_render( array $parsed ): array { | |
| 26 | - return $parsed; | |
| 27 | - } | |
| 28 | - | |
| 29 | 21 | public function get_initial_config() { |
| 30 | 22 | $config = parent::get_initial_config(); |
| 31 | 23 | |
| 32 | 24 | $config['support_nesting'] = true; |
| @@ -36,18 +28,12 @@ | ||
| 36 | 28 | |
| 37 | 29 | return $config; |
| 38 | 30 | } |
| 39 | 31 | |
| 40 | - protected function get_shared_templates(): array { | |
| 41 | - return [ | |
| 42 | - self::get_macros_template_key() => __DIR__ . '/_macros.html.twig', | |
| 43 | - ]; | |
| 44 | - } | |
| 45 | - | |
| 46 | 32 | protected function get_templates_contents() { |
| 47 | 33 | return array_map( |
| 48 | 34 | fn ( $path ) => Utils::file_get_contents( $path ), |
| 49 | - array_merge( $this->get_shared_templates(), $this->get_templates() ) | |
| 35 | + $this->get_templates() | |
| 50 | 36 | ); |
| 51 | 37 | } |
| 52 | 38 | |
| 53 | 39 | protected function render() { |
| @@ -53,11 +39,9 @@ | ||
| 53 | 39 | protected function render() { |
| 54 | 40 | try { |
| 55 | 41 | $renderer = Template_Renderer::instance(); |
| 56 | 42 | |
| 57 | - $all_templates = array_merge( $this->get_shared_templates(), $this->get_templates() ); | |
| 58 | - | |
| 59 | - foreach ( $all_templates as $name => $path ) { | |
| 43 | + foreach ( $this->get_templates() as $name => $path ) { | |
| 60 | 44 | if ( $renderer->is_registered( $name ) ) { |
| 61 | 45 | continue; |
| 62 | 46 | } |
| 63 | 47 | |
| @@ -94,16 +78,13 @@ | ||
| 94 | 78 | return '<!-- elementor-children-placeholder -->'; |
| 95 | 79 | } |
| 96 | 80 | |
| 97 | 81 | protected function build_base_template_context(): array { |
| 98 | - $settings = $this->get_atomic_settings(); | |
| 99 | - | |
| 100 | 82 | return [ |
| 101 | 83 | 'id' => $this->get_id(), |
| 102 | 84 | 'interaction_id' => $this->get_interaction_id(), |
| 103 | 85 | 'type' => $this->get_name(), |
| 104 | - 'settings' => $settings, | |
| 105 | - 'tag' => static::get_computed_html_tag( $settings ), | |
| 86 | + 'settings' => $this->get_atomic_settings(), | |
| 106 | 87 | 'base_styles' => $this->get_base_styles_dictionary(), |
| 107 | 88 | 'children_placeholder' => $this->get_children_placeholder(), |
| 108 | 89 | ]; |
| 109 | 90 | } |