← All changes
|
includes/editor-templates/panel-elements.php
+21
-25
4.1.2
→
4.3.0-beta3
View file →
| @@ -31,14 +31,9 @@ | ||
| 31 | 31 | 'message' => __( 'Get more with Elementor Pro', 'elementor' ), |
| 32 | 32 | 'button_text' => __( 'Upgrade Now', 'elementor' ), |
| 33 | 33 | 'show_banner' => ! $has_pro, |
| 34 | 34 | ] ); |
| 35 | - $promotion_data_sticky = [ | |
| 36 | - 'url' => 'https://go.elementor.com/go-pro-sticky-widget-panel/', | |
| 37 | - 'message' => __( 'Access all Pro widgets.', 'elementor' ), | |
| 38 | - 'button_text' => __( 'Upgrade Now', 'elementor' ), | |
| 39 | - ]; | |
| 40 | - $promotion_data_sticky = Filtered_Promotions_Manager::get_filtered_promotion_data( $promotion_data_sticky, 'elementor/editor/panel/get_pro_details-sticky', 'url' ); | |
| 35 | + $promotion_data_sticky = Filtered_Promotions_Manager::get_editor_panel_sticky_promotion(); | |
| 41 | 36 | ?> |
| 42 | 37 | <?php if ( $get_pro_details['show_banner'] ) : ?> |
| 43 | 38 | <div id="elementor-panel-get-pro-elements" class="elementor-nerd-box"> |
| 44 | 39 | <img class="elementor-nerd-box-icon" src="<?php echo ELEMENTOR_ASSETS_URL . 'images/go-pro.svg'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>" loading="lazy" alt="<?php echo esc_attr__( 'Upgrade', 'elementor' ); ?>" /> |
| @@ -46,18 +41,18 @@ | ||
| 46 | 41 | <a class="elementor-button go-pro" target="_blank" href="<?php echo esc_url( $get_pro_details['link'] ); ?>"><?php echo esc_html( $get_pro_details['button_text'] ); ?></a> |
| 47 | 42 | </div> |
| 48 | 43 | <?php endif; ?> |
| 49 | 44 | <?php if ( ! $has_pro ) : ?> |
| 50 | - <div id="elementor-panel-get-pro-elements-sticky"> | |
| 51 | - <img class="elementor-nerd-box-icon" src="<?php echo ELEMENTOR_ASSETS_URL . 'images/unlock-sticky.svg'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>" loading="lazy" alt="<?php echo esc_attr__( 'Upgrade', 'elementor' ); ?>"/> | |
| 52 | - <div class="elementor-get-pro-sticky-message"> | |
| 53 | - <?php echo esc_html( $promotion_data_sticky['message'] ); ?> | |
| 54 | - <a target="_blank" href="<?php echo esc_url( $promotion_data_sticky['url'] ); ?>"><?php echo esc_html( $promotion_data_sticky['button_text'] ); ?></a> | |
| 55 | - </div> | |
| 56 | - </div> | |
| 45 | + <?php require __DIR__ . '/panel-elements-sticky-promotion.php'; ?> | |
| 57 | 46 | <?php endif; ?> |
| 58 | 47 | </script> |
| 59 | 48 | |
| 49 | +<script type="text/template" id="tmpl-elementor-panel-element-sticky-promotion"> | |
| 50 | + <?php if ( ! $has_pro ) : ?> | |
| 51 | + <?php require __DIR__ . '/panel-elements-sticky-promotion.php'; ?> | |
| 52 | + <?php endif; ?> | |
| 53 | +</script> | |
| 54 | + | |
| 60 | 55 | <script type="text/template" id="tmpl-elementor-panel-elements-category"> |
| 61 | 56 | <button class="elementor-panel-heading elementor-panel-category-title"> |
| 62 | 57 | <span class="elementor-panel-heading-toggle"> |
| 63 | 58 | <i class="eicon-caret-right" aria-hidden="true"></i> |
| @@ -66,9 +61,9 @@ | ||
| 66 | 61 | <?php do_action( 'elementor/editor/templates/panel/category' ); ?> |
| 67 | 62 | <# if ( 'undefined' !== typeof promotion && promotion ) { #> |
| 68 | 63 | <span class="elementor-panel-heading-promotion"> |
| 69 | 64 | <a href="{{{ promotion.url }}}" target="_blank"> |
| 70 | - <i class="eicon-upgrade-crown"></i><?php echo esc_html__( 'Upgrade', 'elementor' ); ?> | |
| 65 | + <i class="eicon-upgrade-crown-full"></i>{{{ promotion.text || <?php echo wp_json_encode( __( 'Upgrade', 'elementor' ) ); ?> }}} | |
| 71 | 66 | </a> |
| 72 | 67 | </span> |
| 73 | 68 | <# } #> |
| 74 | 69 | </button> |
| @@ -87,14 +82,17 @@ | ||
| 87 | 82 | <# const v4Categories = ['v4-elements', 'atomic-form']; #> |
| 88 | 83 | <button class="elementor-element" data-library-element-type="{{ elType === 'widget' ? widgetType : elType }}"> |
| 89 | 84 | <# if ( obj.integration ) { #> |
| 90 | 85 | <i class="eicon-plug"></i> |
| 91 | - <# } else if ( false === obj.editable && !obj.atomicFormPromotion && !obj.birthdayEasterEgg ) { #> | |
| 86 | + <# } else if ( false === obj.editable ) { #> | |
| 92 | 87 | <i class="eicon-lock"></i> |
| 88 | + <# } else if ( obj.categories.some( category => v4Categories.includes( category ) ) ) { #> | |
| 89 | + <# if ( obj.isNew ) { #> | |
| 90 | + <span class="e-widget-new-badge" aria-label="<?php echo esc_attr__( 'New', 'elementor' ); ?>"><?php echo esc_html__( 'New', 'elementor' ); ?></span> | |
| 91 | + <# } else { #> | |
| 92 | + <i class="eicon-atomic"></i> | |
| 93 | + <# } #> | |
| 93 | 94 | <# } #> |
| 94 | - <# if ( !obj.birthdayEasterEgg && obj.categories.some( category => v4Categories.includes( category ) ) ) { #> | |
| 95 | - <i class="eicon-atomic"></i> | |
| 96 | - <# } #> | |
| 97 | 95 | <div class="icon"> |
| 98 | 96 | <i class="{{ icon }}" aria-hidden="true"></i> |
| 99 | 97 | </div> |
| 100 | 98 | <div class="title-wrapper"> |
| @@ -102,14 +100,13 @@ | ||
| 102 | 100 | </div> |
| 103 | 101 | </button> |
| 104 | 102 | </script> |
| 105 | 103 | |
| 106 | -<?php if ( Plugin::$instance->experiments->is_feature_active( Modules\WidgetCreation\Module::EXPERIMENT_NAME ) ) : ?> | |
| 107 | - <?php | |
| 108 | - $widget_creation_cta_text = Hints::is_plugin_active( 'angie' ) | |
| 109 | - ? __( 'Create custom widget', 'elementor' ) | |
| 110 | - : __( 'Try for free', 'elementor' ); | |
| 111 | - ?> | |
| 104 | +<?php | |
| 105 | +$widget_creation_cta_text = Hints::is_plugin_active( 'angie' ) | |
| 106 | + ? __( 'Create custom widget', 'elementor' ) | |
| 107 | + : __( 'Try for free', 'elementor' ); | |
| 108 | +?> | |
| 112 | 109 | <script type="text/template" id="tmpl-elementor-panel-elements-widget-creation-empty-state"> |
| 113 | 110 | <div class="elementor-panel-elements-widget-creation__title"><?php echo esc_html__( 'No widget found for', 'elementor' ); ?> "{{{ searchTerm }}}"</div> |
| 114 | 111 | <div class="elementor-panel-elements-widget-creation__message"><?php echo esc_html__( 'Build a custom widget with Angie by describing what you need.', 'elementor' ); ?></div> |
| 115 | 112 | <?php if ( current_user_can( 'manage_options' ) ) : ?> |
| @@ -123,9 +120,8 @@ | ||
| 123 | 120 | <?php if ( current_user_can( 'manage_options' ) ) : ?> |
| 124 | 121 | <button type="button" class="elementor-panel-elements-widget-creation__cta"><?php echo esc_html( $widget_creation_cta_text ); ?></button> |
| 125 | 122 | <?php endif; ?> |
| 126 | 123 | </script> |
| 127 | -<?php endif; ?> | |
| 128 | 124 | |
| 129 | 125 | <script type="text/template" id="tmpl-elementor-panel-global"> |
| 130 | 126 | <div class="elementor-nerd-box"> |
| 131 | 127 | <img class="elementor-nerd-box-icon" src="<?php echo ELEMENTOR_ASSETS_URL . 'images/information.svg'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>" loading="lazy" alt="<?php echo esc_attr__( 'Elementor', 'elementor' ); ?>" /> |