diff --git src/wp-includes/rest-api.php src/wp-includes/rest-api.php
index e408522ab6..799c871b1a 100644
|
|
function rest_api_register_rewrites() { |
178 | 178 | * @since 4.4.0 |
179 | 179 | */ |
180 | 180 | function rest_api_default_filters() { |
181 | | // Deprecated reporting. |
182 | | add_action( 'deprecated_function_run', 'rest_handle_deprecated_function', 10, 3 ); |
183 | | add_filter( 'deprecated_function_trigger_error', '__return_false' ); |
184 | | add_action( 'deprecated_argument_run', 'rest_handle_deprecated_argument', 10, 3 ); |
185 | | add_filter( 'deprecated_argument_trigger_error', '__return_false' ); |
| 181 | if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { |
| 182 | // Deprecated reporting. |
| 183 | add_action( 'deprecated_function_run', 'rest_handle_deprecated_function', 10, 3 ); |
| 184 | add_filter( 'deprecated_function_trigger_error', '__return_false' ); |
| 185 | add_action( 'deprecated_argument_run', 'rest_handle_deprecated_argument', 10, 3 ); |
| 186 | add_filter( 'deprecated_argument_trigger_error', '__return_false' ); |
| 187 | } |
186 | 188 | |
187 | 189 | // Default serving. |
188 | 190 | add_filter( 'rest_pre_serve_request', 'rest_send_cors_headers' ); |