PluginProbe
Elementor Website Builder – more than just a page builder / 3.25.2
Elementor Website Builder – more than just a page builder v3.25.2
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 4.1.0-dev1 4.0.7 All 451 releases
← All changes | modules/dev-tools/deprecation.php +29 -28 4.2.03.25.2 View file →
@@ -1,9 +1,7 @@
1 1 <?php
2 2 namespace Elementor\Modules\DevTools;
3 3
4 -use Elementor\Utils;
5 -
6 4 if ( ! defined( 'ABSPATH' ) ) {
7 5 exit; // Exit if accessed directly.
8 6 }
9 7
@@ -65,9 +63,9 @@
65 63 *
66 64 * @since 3.1.0
67 65 *
68 66 * @param string $version
69 - * @param int $count
67 + * @param int $count
70 68 *
71 69 * @return string|false
72 70 */
73 71 public function get_next_version( $version, $count = 1 ) {
@@ -186,10 +184,10 @@
186 184 * @param string $version
187 185 * @param string $replacement Optional
188 186 * @param string $base_version Optional. Default is `null`
189 187 *
190 - * @return bool
191 - * @throws \Exception Invalid deprecation.
188 + * @return bool|void
189 + * @throws \Exception
192 190 */
193 191 private function check_deprecation( $entity, $version, $replacement, $base_version = null ) {
194 192 if ( null === $base_version ) {
195 193 $base_version = $this->current_version;
@@ -211,9 +209,9 @@
211 209 $replacement,
212 210 ];
213 211 }
214 212
215 - if ( Utils::is_elementor_debug() ) {
213 + if ( defined( 'ELEMENTOR_DEBUG' ) && ELEMENTOR_DEBUG ) {
216 214 $print_deprecated = true;
217 215 }
218 216 }
219 217
@@ -226,20 +224,20 @@
226 224 * Handles the deprecation process for functions.
227 225 *
228 226 * @since 3.1.0
229 227 *
230 - * @param string $function_name
228 + * @param string $function
231 229 * @param string $version
232 - * @param string $replacement Optional. Default is ''
233 - * @param string $base_version Optional. Default is `null`
234 - * @throws \Exception Deprecation error.
230 + * @param string $replacement Optional. Default is ''
231 + * @param string $base_version Optional. Default is `null`
232 + * @throws \Exception
235 233 */
236 - public function deprecated_function( $function_name, $version, $replacement = '', $base_version = null ) {
237 - $print_deprecated = $this->check_deprecation( $function_name, $version, $replacement, $base_version );
234 + public function deprecated_function( $function, $version, $replacement = '', $base_version = null ) {
235 + $print_deprecated = $this->check_deprecation( $function, $version, $replacement, $base_version );
238 236
239 237 if ( $print_deprecated ) {
240 238 // PHPCS - We need to echo special characters because they can exist in function calls.
241 - _deprecated_function( $function_name, esc_html( $version ), $replacement ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
239 + _deprecated_function( $function, esc_html( $version ), $replacement ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
242 240 }
243 241 }
244 242
245 243 /**
@@ -246,14 +244,15 @@
246 244 * Deprecated Hook
247 245 *
248 246 * Handles the deprecation process for hooks.
249 247 *
248 + * @since 3.1.0
249 + *
250 250 * @param string $hook
251 251 * @param string $version
252 252 * @param string $replacement Optional. Default is ''
253 253 * @param string $base_version Optional. Default is `null`
254 - * @throws \Exception Deprecation error.
255 - * @since 3.1.0
254 + * @throws \Exception
256 255 */
257 256 public function deprecated_hook( $hook, $version, $replacement = '', $base_version = null ) {
258 257 $print_deprecated = $this->check_deprecation( $hook, $version, $replacement, $base_version );
259 258
@@ -272,9 +271,9 @@
272 271 * @param string $argument
273 272 * @param string $version
274 273 * @param string $replacement
275 274 * @param string $message
276 - * @throws \Exception Deprecation error.
275 + * @throws \Exception
277 276 */
278 277 public function deprecated_argument( $argument, $version, $replacement = '', $message = '' ) {
279 278 $print_deprecated = $this->check_deprecation( $argument, $version, $replacement );
280 279
@@ -308,16 +307,17 @@
308 307 * Do Deprecated Action
309 308 *
310 309 * A method used to run deprecated actions through Elementor's deprecation process.
311 310 *
312 - * @param string $hook
313 - * @param array $args
314 - * @param string $version
315 - * @param string $replacement
311 + * @since 3.1.0
312 + *
313 + * @param string $hook
314 + * @param array $args
315 + * @param string $version
316 + * @param string $replacement
316 317 * @param null|string $base_version
317 318 *
318 - * @throws \Exception Deprecation error.
319 - * @since 3.1.0
319 + * @throws \Exception
320 320 */
321 321 public function do_deprecated_action( $hook, $args, $version, $replacement = '', $base_version = null ) {
322 322 if ( ! has_action( $hook ) ) {
323 323 return;
@@ -332,17 +332,18 @@
332 332 * Apply Deprecated Filter
333 333 *
334 334 * A method used to run deprecated filters through Elementor's deprecation process.
335 335 *
336 - * @param string $hook
337 - * @param array $args
338 - * @param string $version
339 - * @param string $replacement
336 + * @since 3.2.0
337 + *
338 + * @param string $hook
339 + * @param array $args
340 + * @param string $version
341 + * @param string $replacement
340 342 * @param null|string $base_version
341 343 *
342 344 * @return mixed
343 - * @throws \Exception Deprecation error.
344 - * @since 3.2.0
345 + * @throws \Exception
345 346 */
346 347 public function apply_deprecated_filter( $hook, $args, $version, $replacement = '', $base_version = null ) {
347 348 if ( ! has_action( $hook ) ) {
348 349 // `$args` should be an array, but in order to keep BC, we need to support non-array values.