groups
1 year ago
alert.php
2 years ago
animation.php
3 years ago
base-data.php
3 years ago
base-icon-font.php
3 years ago
base-multiple.php
3 years ago
base-ui.php
3 years ago
base-units.php
2 years ago
base.php
3 years ago
box-shadow.php
3 years ago
button.php
3 years ago
choose.php
3 years ago
code.php
3 years ago
color.php
3 years ago
date-time.php
3 years ago
deprecated-notice.php
3 years ago
dimensions.php
3 years ago
divider.php
2 years ago
exit-animation.php
3 years ago
font.php
3 years ago
gallery.php
2 years ago
gaps.php
2 years ago
heading.php
3 years ago
hidden.php
3 years ago
hover-animation.php
1 year ago
icon.php
2 years ago
icons.php
2 years ago
image-dimensions.php
3 years ago
media.php
2 years ago
notice.php
2 years ago
number.php
3 years ago
popover-toggle.php
3 years ago
raw-html.php
3 years ago
repeater.php
1 year ago
section.php
2 years ago
select.php
3 years ago
select2.php
2 years ago
slider.php
3 years ago
structure.php
2 years ago
switcher.php
3 years ago
tab.php
2 years ago
tabs.php
2 years ago
text-shadow.php
3 years ago
text.php
3 years ago
textarea.php
3 years ago
url.php
2 years ago
wp-widget.php
3 years ago
wysiwyg.php
3 years ago
deprecated-notice.php
81 lines
| 1 | <?php |
| 2 | namespace Elementor; |
| 3 | |
| 4 | if ( ! defined( 'ABSPATH' ) ) { |
| 5 | exit; // Exit if accessed directly. |
| 6 | } |
| 7 | |
| 8 | /** |
| 9 | * Elementor Deprecated Notice control. |
| 10 | * |
| 11 | * A base control specific for creating Deprecation Notices control. |
| 12 | * Displays a warning notice in the panel. |
| 13 | * |
| 14 | * @since 2.6.0 |
| 15 | */ |
| 16 | class Control_Deprecated_Notice extends Base_UI_Control { |
| 17 | |
| 18 | /** |
| 19 | * Get deprecated-notice control type. |
| 20 | * |
| 21 | * Retrieve the control type, in this case `deprecated_notice`. |
| 22 | * |
| 23 | * @since 2.6.0 |
| 24 | * @access public |
| 25 | * |
| 26 | * @return string Control type. |
| 27 | */ |
| 28 | public function get_type() { |
| 29 | return 'deprecated_notice'; |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Render deprecated notice control output in the editor. |
| 34 | * |
| 35 | * Used to generate the control HTML in the editor using Underscore JS |
| 36 | * template. The variables for the class are available using `data` JS |
| 37 | * object. |
| 38 | * |
| 39 | * @since 2.6.0 |
| 40 | * @access public |
| 41 | */ |
| 42 | public function content_template() { |
| 43 | ?> |
| 44 | <# if ( data.label ) { #> |
| 45 | <span class="elementor-control-title">{{{ data.label }}}</span> |
| 46 | <# |
| 47 | } |
| 48 | let notice = wp.i18n.sprintf( wp.i18n.__( 'The <strong>%1$s</strong> widget has been deprecated since %2$s %3$s.', 'elementor' ), data.widget, data.plugin, data.since ); |
| 49 | if ( data.replacement ) { |
| 50 | notice += '<br>' + wp.i18n.sprintf( wp.i18n.__( 'It has been replaced by <strong>%1$s</strong>.', 'elementor' ), data.replacement ); |
| 51 | } |
| 52 | if ( data.last ) { |
| 53 | notice += '<br>' + wp.i18n.sprintf( wp.i18n.__( 'Note that %1$s will be completely removed once %2$s %3$s is released.', 'elementor' ), data.widget, data.plugin, data.last ); |
| 54 | } |
| 55 | #> |
| 56 | <div class="elementor-control-deprecated-notice elementor-panel-alert elementor-panel-alert-warning">{{{ notice }}}</div> |
| 57 | <?php |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Get deprecated-notice control default settings. |
| 62 | * |
| 63 | * Retrieve the default settings of the deprecated notice control. Used to return the |
| 64 | * default settings while initializing the deprecated notice control. |
| 65 | * |
| 66 | * @since 2.6.0 |
| 67 | * @access protected |
| 68 | * |
| 69 | * @return array Control default settings. |
| 70 | */ |
| 71 | protected function get_default_settings() { |
| 72 | return [ |
| 73 | 'widget' => '', // Widgets name |
| 74 | 'since' => '', // Plugin version widget was deprecated |
| 75 | 'last' => '', // Plugin version in which the widget will be removed |
| 76 | 'plugin' => '', // Plugin's title |
| 77 | 'replacement' => '', // Widget replacement |
| 78 | ]; |
| 79 | } |
| 80 | } |
| 81 |