PluginProbe
Elementor Website Builder – more than just a page builder / 3.21.0-beta2
Elementor Website Builder – more than just a page builder v3.21.0-beta2
4.3.3 4.3.2 4.3.1 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 All 456 releases
← All changes | modules/gutenberg/module.php +9 -20 4.2.1 → 3.21.0-beta2 View file →
@@ -38,14 +38,14 @@
38 38 */
39 39 public function register_elementor_rest_field() {
40 40 register_rest_field( get_post_types( '', 'names' ),
41 41 'gutenberg_elementor_mode', [
42 - 'update_callback' => function( $request_value, $obj ) {
43 - if ( ! User::is_current_user_can_edit( $obj->ID ) ) {
42 + 'update_callback' => function( $request_value, $object ) {
43 + if ( ! User::is_current_user_can_edit( $object->ID ) ) {
44 44 return false;
45 45 }
46 46
47 - $document = Plugin::$instance->documents->get( $obj->ID );
47 + $document = Plugin::$instance->documents->get( $object->ID );
48 48
49 49 if ( ! $document ) {
50 50 return false;
51 51 }
@@ -70,9 +70,9 @@
70 70 }
71 71
72 72 $this->is_gutenberg_editor_active = true;
73 73
74 - $suffix = Utils::is_script_debug() ? '' : '.min';
74 + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
75 75
76 76 wp_enqueue_script( 'elementor-gutenberg', ELEMENTOR_ASSETS_URL . 'js/gutenberg' . $suffix . '.js', [ 'jquery' ], ELEMENTOR_VERSION, true );
77 77
78 78 $elementor_settings = [
@@ -124,19 +124,8 @@
124 124 </div>
125 125 </div>
126 126 </div>
127 127 </script>
128 -
129 - <script id="elementor-gutenberg-button-tmpl" type="text/html">
130 - <div id="elementor-edit-button-gutenberg">
131 - <button id="elementor-edit-mode-button" type="button" class="button button-primary button-large">
132 - <span class="elementor-edit-mode-gutenberg">
133 - <i class="eicon-elementor-square" aria-hidden="true"></i>
134 - <?php echo esc_html__( 'Edit with Elementor', 'elementor' ); ?>
135 - </span>
136 - </button>
137 - </div>
138 - </script>
139 128 <?php
140 129 }
141 130
142 131 /**
@@ -173,13 +162,13 @@
173 162 *
174 163 * @since 3.21.0
175 164 * @access private
176 165 */
177 - private static function is_optimized_gutenberg_loading_enabled(): bool {
166 + private static function is_optimized_gutenberg_loading_enabled() : bool {
178 167 return (bool) get_option( 'elementor_optimized_gutenberg_loading', '1' );
179 168 }
180 169
181 - private static function should_dequeue_gutenberg_assets(): bool {
170 + private static function should_dequeue_gutenberg_assets() : bool {
182 171 $post = get_post();
183 172
184 173 if ( empty( $post->ID ) ) {
185 174 return false;
@@ -195,9 +184,9 @@
195 184
196 185 return true;
197 186 }
198 187
199 - private static function is_built_with_elementor( $post ): bool {
188 + private static function is_built_with_elementor( $post ) : bool {
200 189 $document = Plugin::$instance->documents->get( $post->ID );
201 190
202 191 if ( ! $document || ! $document->is_built_with_elementor() ) {
203 192 return false;
@@ -205,9 +194,9 @@
205 194
206 195 return true;
207 196 }
208 197
209 - private static function is_gutenberg_in_post( $post ): bool {
198 + private static function is_gutenberg_in_post( $post ) : bool {
210 199 if ( has_blocks( $post ) ) {
211 200 return true;
212 201 }
213 202
@@ -217,9 +206,9 @@
217 206
218 207 return false;
219 208 }
220 209
221 - private static function current_theme_is_fse_theme(): bool {
210 + private static function current_theme_is_fse_theme() : bool {
222 211 if ( function_exists( 'wp_is_block_theme' ) ) {
223 212 return (bool) wp_is_block_theme();
224 213 }
225 214 if ( function_exists( 'gutenberg_is_fse_theme' ) ) {