Ticket #38446: 38446.diff
File 38446.diff, 1.1 KB (added by , 9 years ago) |
---|
-
src/wp-includes/rest-api/class-wp-rest-server.php
260 260 * Filters whether the REST API is enabled. 261 261 * 262 262 * @since 4.4.0 263 * @deprecated deprecated since 4.7 263 264 * 264 265 * @param bool $rest_enabled Whether the REST API is enabled. Default true. 265 266 */ 266 $enabled = apply_filters ( 'rest_enabled', true);267 $enabled = apply_filters_deprecated( 'rest_enabled', true, '4.7.0', false, __( 'The REST API can not be completely disabled as core functionality depends upon it' ) ); 267 268 268 269 /** 269 270 * Filters whether jsonp is enabled. … … 276 277 277 278 $jsonp_callback = null; 278 279 279 if ( ! $enabled ) {280 echo $this->json_error( 'rest_disabled', __( 'The REST API is disabled on this site.' ), 404 );281 return false;282 }283 280 if ( isset( $_GET['_jsonp'] ) ) { 284 281 if ( ! $jsonp_enabled ) { 285 282 echo $this->json_error( 'rest_callback_disabled', __( 'JSONP support is disabled on this site.' ), 400 );