← All changes
|
modules/kit-elements-defaults/data/controller.php
+2
-11
4.1.3
→
3.20.0-dev3
View file →
| @@ -1,8 +1,7 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | namespace Elementor\Modules\KitElementsDefaults\Data; |
| 3 | 3 | |
| 4 | -use Elementor\Core\Frontend\Performance; | |
| 5 | 4 | use Elementor\Modules\KitElementsDefaults\Module; |
| 6 | 5 | use Elementor\Modules\KitElementsDefaults\Utils\Settings_Sanitizer; |
| 7 | 6 | use Elementor\Plugin; |
| 8 | 7 | use Elementor\Data\V2\Base\Exceptions\Error_404; |
| @@ -37,25 +36,19 @@ | ||
| 37 | 36 | 'validate_callback' => function( $settings ) { |
| 38 | 37 | return is_array( $settings ); |
| 39 | 38 | }, |
| 40 | 39 | 'sanitize_callback' => function( $settings, \WP_REST_Request $request ) { |
| 41 | - Performance::set_use_style_controls( true ); | |
| 42 | - | |
| 43 | 40 | $sanitizer = new Settings_Sanitizer( |
| 44 | 41 | Plugin::$instance->elements_manager, |
| 45 | 42 | array_keys( Plugin::$instance->widgets_manager->get_widget_types() ) |
| 46 | 43 | ); |
| 47 | 44 | |
| 48 | - $sanitized_data = $sanitizer | |
| 45 | + return $sanitizer | |
| 49 | 46 | ->for( $request->get_param( 'type' ) ) |
| 50 | 47 | ->using( $settings ) |
| 51 | 48 | ->remove_invalid_settings() |
| 52 | 49 | ->kses_deep() |
| 53 | 50 | ->get(); |
| 54 | - | |
| 55 | - Performance::set_use_style_controls( false ); | |
| 56 | - | |
| 57 | - return $sanitized_data; | |
| 58 | 51 | }, |
| 59 | 52 | ], |
| 60 | 53 | ] ); |
| 61 | 54 | |
| @@ -136,11 +129,9 @@ | ||
| 136 | 129 | public function get_items_permissions_check( $request ) { |
| 137 | 130 | return current_user_can( 'edit_posts' ); |
| 138 | 131 | } |
| 139 | 132 | |
| 140 | - /** | |
| 141 | - * TODO: Should be removed once the infra will support it. | |
| 142 | - */ | |
| 133 | + // TODO: Should be removed once the infra will support it. | |
| 143 | 134 | public function get_item_permissions_check( $request ) { |
| 144 | 135 | return $this->get_items_permissions_check( $request ); |
| 145 | 136 | } |
| 146 | 137 | |