PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.4.5
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.4.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
← All changes | includes/Core/Platform/Elementor.php +3 -45 3.6.13.4.5 View file →
@@ -47,9 +47,8 @@
47 47 * @return void
48 48 */
49 49 public function styles() {
50 50 templately()->assets->enqueue( 'templately-elementor-preview', 'css/elementor.css' );
51 - templately()->assets->enqueue( 'templately-tailwind', 'css/tailwind.css', ['templately-elementor-preview'] );
52 51 }
53 52
54 53 /**
55 54 * Assets Enqueueing
@@ -56,9 +55,8 @@
56 55 * @return void
57 56 */
58 57 public function scripts() {
59 58 templately()->assets->enqueue( 'templately-elementor', 'css/elementor.css' );
60 - templately()->assets->enqueue( 'templately-tailwind', 'css/tailwind.css', ['templately-elementor'] );
61 59 templately()->assets->enqueue( 'templately-elementor', 'js/elementor.js', [ 'jquery' ], true );
62 60 templately()->admin->scripts( 'elementor' );
63 61 }
64 62
@@ -76,9 +74,9 @@
76 74 * Checking the template eligibility for import.
77 75 *
78 76 * @return WP_Error|void
79 77 */
80 - protected function is_eligible( $template, $types = [ 'page', 'section','block' ] ) {
78 + protected function is_eligible( $template, $types = [ 'page', 'section' ] ) {
81 79 if ( ! Helper::is_plugin_active( 'elementor-pro/elementor-pro.php' ) &&
82 80 isset( $template['type'] ) &&
83 81 ! in_array( $template['type'], $types, true )
84 82 ) {
@@ -242,9 +240,9 @@
242 240 * @since 2.0.0
243 241 *
244 242 * @return array|WP_Error array on success, WP_Error on failure.
245 243 */
246 - public function create_page( $id, $title, $importer = null, $settings = [] ) {
244 + public function create_page( $id, $title, $importer = null ) {
247 245 $template_data = $importer->get_content( $id );
248 246
249 247 if ( is_wp_error( $template_data ) ) {
250 248 return $template_data;
@@ -249,12 +247,8 @@
249 247 if ( is_wp_error( $template_data ) ) {
250 248 return $template_data;
251 249 }
252 250
253 - if ( ! empty( $settings ) && ! empty( $template_data['content'] ) && is_array( $template_data['content'] ) ) {
254 - $template_data['content'] = \Templately\Core\Importer\Utils\ElementorSettingsMerger::merge( $template_data['content'], $settings );
255 - }
256 -
257 251 $importer = new ElementorImporter;
258 252 $template_data = $importer->get_data( $template_data );
259 253
260 254 if ( ! empty( $title ) ) {
@@ -287,9 +281,9 @@
287 281 'visit' => get_permalink( $inserted_ID )
288 282 ];
289 283 }
290 284
291 - public function import_in_library( $id, $importer = null, $settings = [] ) {
285 + public function import_in_library( $id, $importer = null ) {
292 286 $template_data = $importer->get_content( $id, 'elementor', 'remote' );
293 287
294 288 if ( is_wp_error( $template_data ) ) {
295 289 return $template_data;
@@ -294,16 +288,8 @@
294 288 if ( is_wp_error( $template_data ) ) {
295 289 return $template_data;
296 290 }
297 291
298 - if ( ! empty( $settings ) && ! empty( $template_data['content'] ) && is_array( $template_data['content'] ) ) {
299 - $template_data['content'] = \Templately\Core\Importer\Utils\ElementorSettingsMerger::merge( $template_data['content'], $settings );
300 - }
301 -
302 - if(trim($template_data['type']) == 'block'){
303 - $template_data['type'] = 'section';
304 - }
305 -
306 292 $importer = new ElementorImporter;
307 293 $imported_template = $importer->import_in_library( $template_data );
308 294
309 295 if( is_wp_error( $imported_template ) ) {
@@ -342,34 +328,6 @@
342 328 public function insert( $data ) {
343 329 $importer = new ElementorImporter();
344 330
345 331 return $importer->get_data( $data );
346 - }
347 -
348 - /**
349 - * Filter Child Type
350 - *
351 - * @param $child_type
352 - * @param $element_data
353 - * @param $element
354 - *
355 - * @return mixed
356 - */
357 - public static function filter_child_type( $child_type, $element_data, $element ) {
358 - // Fix for Elementor Pro Promotion Widget
359 - if ( is_a( $element, 'Elementor\Modules\Promotions\Widgets\Pro_Widget_Promotion' ) || ( is_object( $element ) && 'pro-promotion' === $element->get_name() ) ) {
360 - $el_types = array_keys( Plugin::$instance->elements_manager->get_element_types() );
361 -
362 - if ( isset( $element_data['elType'] ) && in_array( $element_data['elType'], $el_types, true ) ) {
363 - return Plugin::$instance->elements_manager->get_element_types( $element_data['elType'] );
364 - }
365 -
366 - if ( ! isset( $element_data['widgetType'] ) ) {
367 - return null;
368 - }
369 -
370 - return Plugin::$instance->widgets_manager->get_widget_types( $element_data['widgetType'] );
371 - }
372 -
373 - return $child_type;
374 332 }
375 333 }