PluginProbe
Elementor Website Builder – more than just a page builder / 3.6.2
Elementor Website Builder – more than just a page builder v3.6.2
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 4.1.0-dev2 All 455 releases
← All changes | core/files/assets/svg/svg-handler.php +23 -41 4.3.0 → 3.6.2 View file →
@@ -12,22 +12,19 @@
12 12
13 13 /**
14 14 * SVG Handler
15 15 *
16 - * @deprecated 3.5.0 Use `Elementor\Core\Files\File_Types\Svg` instead, accessed by calling: `Plugin::$instance->uploads_manager->get_file_type_handlers( 'svg' );`
16 + * Deprecated, use Elementor\Core\Files\File_Types\Svg instead, accessed by calling:
17 + * `Plugin::$instance->uploads_manager->get_file_type_handlers( 'svg' );`
18 + *
19 + * @deprecated 3.5.0
17 20 */
18 21 class Svg_Handler extends Files_Upload_Handler {
19 -
20 22 /**
21 23 * Inline svg attachment meta key
22 - *
23 - * @deprecated 3.5.0
24 24 */
25 25 const META_KEY = '_elementor_inline_svg';
26 26
27 - /**
28 - * @deprecated 3.5.0
29 - */
30 27 const SCRIPT_REGEX = '/(?:\w+script|data):/xi';
31 28
32 29 /**
33 30 * Attachment ID.
@@ -33,23 +30,18 @@
33 30 * Attachment ID.
34 31 *
35 32 * Holds the current attachment ID.
36 33 *
37 - * @deprecated 3.5.0
38 - *
39 34 * @var int
40 35 */
41 36 private $attachment_id;
42 37
43 - /**
44 - * @deprecated 3.5.0
45 - */
46 38 public static function get_name() {
47 39 return 'svg-handler';
48 40 }
49 41
50 42 /**
51 - * Get meta
43 + * get_meta
52 44 *
53 45 * @deprecated 3.5.0
54 46 *
55 47 * @return mixed
@@ -60,9 +52,9 @@
60 52 return get_post_meta( $this->attachment_id, self::META_KEY, true );
61 53 }
62 54
63 55 /**
64 - * Update meta
56 + * update_meta
65 57 *
66 58 * @deprecated 3.5.0
67 59 *
68 60 * @param $meta
@@ -73,9 +65,9 @@
73 65 update_post_meta( $this->attachment_id, self::META_KEY, $meta );
74 66 }
75 67
76 68 /**
77 - * Delete meta
69 + * delete_meta
78 70 *
79 71 * @deprecated 3.5.0
80 72 */
81 73 protected function delete_meta() {
@@ -83,30 +75,20 @@
83 75
84 76 delete_post_meta( $this->attachment_id, self::META_KEY );
85 77 }
86 78
87 - /**
88 - * Get mime type
89 - *
90 - * @deprecated 3.5.0
91 - */
92 79 public function get_mime_type() {
93 80 return 'image/svg+xml';
94 81 }
95 82
96 - /**
97 - * Get file type
98 - *
99 - * @deprecated 3.5.0
100 - */
101 83 public function get_file_type() {
102 84 return 'svg';
103 85 }
104 86
105 87 /**
106 - * Delete meta cache
88 + * delete_meta_cache
107 89 *
108 - * @deprecated 3.5.0 Use `Plugin::$instance->uploads_manager->get_file_type_handlers( 'svg' )->delete_meta_cache()` instead.
90 + * @deprecated 3.5.0
109 91 */
110 92 public function delete_meta_cache() {
111 93 Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.5.0', 'Plugin::$instance->uploads_manager->get_file_type_handlers( \'svg\' )->delete_meta_cache()' );
112 94
@@ -116,11 +98,11 @@
116 98 $svg_handler->delete_meta_cache();
117 99 }
118 100
119 101 /**
120 - * Get inline svg
102 + * get_inline_svg
121 103 *
122 - * @deprecated 3.5.0 Use `Elementor\Core\Files\File_Types\Svg::get_inline_svg()` instead.
104 + * @deprecated 3.5.0
123 105 *
124 106 * @param $attachment_id
125 107 *
126 108 * @return bool|mixed|string
@@ -131,11 +113,11 @@
131 113 return Svg::get_inline_svg( $attachment_id );
132 114 }
133 115
134 116 /**
135 - * Sanitize svg
117 + * sanitize_svg
136 118 *
137 - * @deprecated 3.5.0 Use `Plugin::$instance->uploads_manager->get_file_type_handlers( 'svg' )->delete_meta_cache()->sanitize_svg()` instead.
119 + * @deprecated 3.5.0
138 120 *
139 121 * @param $filename
140 122 *
141 123 * @return bool
@@ -149,11 +131,11 @@
149 131 return $svg_handler->sanitize_svg( $filename );
150 132 }
151 133
152 134 /**
153 - * Sanitizer
135 + * sanitizer
154 136 *
155 - * @deprecated 3.5.0 Use `Plugin::$instance->uploads_manager->get_file_type_handlers( 'svg' )->sanitizer()` instead.
137 + * @deprecated 3.5.0
156 138 *
157 139 * @param $content
158 140 *
159 141 * @return bool|string
@@ -167,11 +149,11 @@
167 149 return $svg_handler->sanitizer( $content );
168 150 }
169 151
170 152 /**
171 - * Prepare attachment for js
153 + * wp_prepare_attachment_for_js
172 154 *
173 - * @deprecated 3.5.0 Use `Plugin::$instance->uploads_manager->get_file_type_handlers( 'svg' )->wp_prepare_attachment_for_js()` instead.
155 + * @deprecated 3.5.0
174 156 *
175 157 * @param $attachment_data
176 158 * @param $attachment
177 159 * @param $meta
@@ -187,9 +169,9 @@
187 169 return $svg_handler->wp_prepare_attachment_for_js( $attachment_data, $attachment, $meta );
188 170 }
189 171
190 172 /**
191 - * Set attachment id
173 + * set_attachment_id
192 174 *
193 175 * @deprecated 3.5.0
194 176 *
195 177 * @param $attachment_id
@@ -203,9 +185,9 @@
203 185 return $this->attachment_id;
204 186 }
205 187
206 188 /**
207 - * Get attachment id
189 + * get_attachment_id
208 190 *
209 191 * @deprecated 3.5.0
210 192 *
211 193 * @return int
@@ -216,11 +198,11 @@
216 198 return $this->attachment_id;
217 199 }
218 200
219 201 /**
220 - * Set svg meta data
202 + * set_svg_meta_data
221 203 *
222 - * @deprecated 3.5.0 Use `Plugin::$instance->uploads_manager->get_file_type_handlers( 'svg' )->set_svg_meta_data()` instead.
204 + * @deprecated 3.5.0
223 205 *
224 206 * @return mixed
225 207 */
226 208 public function set_svg_meta_data( $data, $id ) {
@@ -232,11 +214,11 @@
232 214 return $svg_handler->set_svg_meta_data( $data, $id );
233 215 }
234 216
235 217 /**
236 - * Handle upload prefilter
218 + * handle_upload_prefilter
237 219 *
238 - * @deprecated 3.5.0 Use `Elementor\Plugin::$instance->uploads_manager->handle_elementor_wp_media_upload()` instead.
220 + * @deprecated 3.5.0
239 221 *
240 222 * @param $file
241 223 *
242 224 * @return mixed