| @@ -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 = [ |
| @@ -173,13 +173,13 @@ | ||
| 173 | 173 | * |
| 174 | 174 | * @since 3.21.0 |
| 175 | 175 | * @access private |
| 176 | 176 | */ |
| 177 | - private static function is_optimized_gutenberg_loading_enabled(): bool { | |
| 177 | + private static function is_optimized_gutenberg_loading_enabled() : bool { | |
| 178 | 178 | return (bool) get_option( 'elementor_optimized_gutenberg_loading', '1' ); |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | - private static function should_dequeue_gutenberg_assets(): bool { | |
| 181 | + private static function should_dequeue_gutenberg_assets() : bool { | |
| 182 | 182 | $post = get_post(); |
| 183 | 183 | |
| 184 | 184 | if ( empty( $post->ID ) ) { |
| 185 | 185 | return false; |
| @@ -195,9 +195,9 @@ | ||
| 195 | 195 | |
| 196 | 196 | return true; |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - private static function is_built_with_elementor( $post ): bool { | |
| 199 | + private static function is_built_with_elementor( $post ) : bool { | |
| 200 | 200 | $document = Plugin::$instance->documents->get( $post->ID ); |
| 201 | 201 | |
| 202 | 202 | if ( ! $document || ! $document->is_built_with_elementor() ) { |
| 203 | 203 | return false; |
| @@ -205,9 +205,9 @@ | ||
| 205 | 205 | |
| 206 | 206 | return true; |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - private static function is_gutenberg_in_post( $post ): bool { | |
| 209 | + private static function is_gutenberg_in_post( $post ) : bool { | |
| 210 | 210 | if ( has_blocks( $post ) ) { |
| 211 | 211 | return true; |
| 212 | 212 | } |
| 213 | 213 | |
| @@ -217,9 +217,9 @@ | ||
| 217 | 217 | |
| 218 | 218 | return false; |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | - private static function current_theme_is_fse_theme(): bool { | |
| 221 | + private static function current_theme_is_fse_theme() : bool { | |
| 222 | 222 | if ( function_exists( 'wp_is_block_theme' ) ) { |
| 223 | 223 | return (bool) wp_is_block_theme(); |
| 224 | 224 | } |
| 225 | 225 | if ( function_exists( 'gutenberg_is_fse_theme' ) ) { |