@@ 34-53 (lines=20) @@ | ||
31 | * @param string $replacement Optional. The function that should have been called. Default null. |
|
32 | * @param string $version The version of Jetpack that deprecated the function. |
|
33 | */ |
|
34 | function jetpack_deprecated_function( $function, $replacement, $version ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
|
35 | // Look for when a function will be removed based on when it was deprecated. |
|
36 | $removed_version = jetpack_get_future_removed_version( $version ); |
|
37 | ||
38 | // If we could find a version, let's log a message about when removal will happen. |
|
39 | if ( |
|
40 | ! empty( $removed_version ) |
|
41 | && ( defined( 'WP_DEBUG' ) && WP_DEBUG ) |
|
42 | ) { |
|
43 | error_log( // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log |
|
44 | sprintf( |
|
45 | /* Translators: 1. Function name. 2. Jetpack version number. */ |
|
46 | __( 'The %1$s function will be removed from the Jetpack plugin in version %2$s.', 'jetpack' ), |
|
47 | $function, |
|
48 | $removed_version |
|
49 | ) |
|
50 | ); |
|
51 | ||
52 | } |
|
53 | } |
|
54 | add_action( 'deprecated_function_run', 'jetpack_deprecated_function', 10, 3 ); |
|
55 | ||
56 | /** |
|
@@ 67-86 (lines=20) @@ | ||
64 | * @param string $version The version of WordPress that deprecated the file. |
|
65 | * @param string $message A message regarding the change. |
|
66 | */ |
|
67 | function jetpack_deprecated_file( $file, $replacement, $version, $message ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
|
68 | // Look for when a file will be removed based on when it was deprecated. |
|
69 | $removed_version = jetpack_get_future_removed_version( $version ); |
|
70 | ||
71 | // If we could find a version, let's log a message about when removal will happen. |
|
72 | if ( |
|
73 | ! empty( $removed_version ) |
|
74 | && ( defined( 'WP_DEBUG' ) && WP_DEBUG ) |
|
75 | ) { |
|
76 | error_log( // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log |
|
77 | sprintf( |
|
78 | /* Translators: 1. File name. 2. Jetpack version number. */ |
|
79 | __( 'The %1$s file will be removed from the Jetpack plugin in version %2$s.', 'jetpack' ), |
|
80 | $file, |
|
81 | $removed_version |
|
82 | ) |
|
83 | ); |
|
84 | ||
85 | } |
|
86 | } |
|
87 | add_action( 'deprecated_file_included', 'jetpack_deprecated_file', 10, 4 ); |
|
88 | ||
89 | /** |