PluginProbe
Elementor Website Builder – more than just a page builder / 3.16.2
Elementor Website Builder – more than just a page builder v3.16.2
4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 All 453 releases
← All changes | core/kits/documents/kit.php +20 -5 4.1.0-dev33.16.2 View file →
@@ -2,14 +2,15 @@
2 2 namespace Elementor\Core\Kits\Documents;
3 3
4 4 use Elementor\Core\DocumentTypes\PageBase;
5 5 use Elementor\Core\Files\CSS\Post as Post_CSS;
6 +use Elementor\Core\Kits\Documents\Tabs;
6 7 use Elementor\Core\Settings\Manager as SettingsManager;
7 8 use Elementor\Core\Settings\Page\Manager as PageManager;
8 9 use Elementor\Plugin;
9 10
10 11 if ( ! defined( 'ABSPATH' ) ) {
11 - exit; // Exit if accessed directly.
12 + exit; // Exit if accessed directly
12 13 }
13 14
14 15 class Kit extends PageBase {
15 16 /**
@@ -110,12 +111,12 @@
110 111 /**
111 112 * Register a kit settings menu.
112 113 *
113 114 * @param $id
114 - * @param $class_name
115 + * @param $class
115 116 */
116 - public function register_tab( $id, $class_name ) {
117 - $this->tabs[ $id ] = new $class_name( $this );
117 + public function register_tab( $id, $class ) {
118 + $this->tabs[ $id ] = new $class( $this );
118 119 }
119 120
120 121 /**
121 122 * @inheritDoc
@@ -141,13 +142,27 @@
141 142 * @since 3.1.0
142 143 * @access protected
143 144 */
144 145 protected function register_controls() {
146 + $is_edit_mode = Plugin::$instance->editor->is_edit_mode();
147 +
148 + if ( ! $is_edit_mode ) {
149 + // In the Front End, the Kit is initialized before CSS is generated, so we always duplicate controls in
150 + // the kit.
151 + $initial_responsive_controls_duplication_mode = Plugin::$instance->breakpoints->get_responsive_control_duplication_mode();
152 +
153 + Plugin::$instance->breakpoints->set_responsive_control_duplication_mode( 'on' );
154 + }
155 +
145 156 $this->register_document_controls();
146 157
147 158 foreach ( $this->tabs as $tab ) {
148 159 $tab->register_controls();
149 160 }
161 +
162 + if ( ! $is_edit_mode ) {
163 + Plugin::$instance->breakpoints->set_responsive_control_duplication_mode( $initial_responsive_controls_duplication_mode );
164 + }
150 165 }
151 166
152 167 protected function get_post_statuses() {
153 168 return [
@@ -172,9 +187,9 @@
172 187
173 188 $page_settings_manager = SettingsManager::get_settings_managers( 'page' );
174 189 $page_settings_manager->save_settings( $document_settings, $this->get_id() );
175 190
176 - /** @var Kit $autosave */
191 + /** @var Kit $autosave **/
177 192 $autosave = $this->get_autosave();
178 193
179 194 if ( $autosave ) {
180 195 $autosave->add_repeater_row( $control_id, $item );