- Timestamp:
- 03/22/2017 11:18:25 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/wcorg-json-api.php
r3770 r5164 18 18 add_filter( 'json_prepare_post', 'wcorg_json_embed_related_posts', 999, 3 ); // after `wcorg_json_expose_additional_post_data()` 19 19 add_action( 'wp_json_server_before_serve', 'wcorg_json_avoid_nested_callback_conflicts', 11 ); // after the default endpoints are added in `json_api_default_filters()` 20 21 add_filter( 'json_prepare_post', 'deprecate_v1_endpoints' ); 22 add_filter( 'json_prepare_page', 'deprecate_v1_endpoints' ); 23 add_filter( 'json_prepare_attachment', 'deprecate_v1_endpoints' ); 24 add_filter( 'json_prepare_revision', 'deprecate_v1_endpoints' ); 25 add_filter( 'json_prepare_wcb_speaker', 'deprecate_v1_endpoints' ); 26 add_filter( 'json_prepare_wcb_session', 'deprecate_v1_endpoints' ); 27 add_filter( 'json_prepare_wcb_sponsor', 'deprecate_v1_endpoints' ); 28 add_filter( 'json_prepare_mes', 'deprecate_v1_endpoints' ); 29 add_filter( 'json_prepare_taxonomy', 'deprecate_v1_endpoints' ); 30 add_filter( 'json_prepare_term', 'deprecate_v1_endpoints' ); 31 add_filter( 'json_prepare_user', 'deprecate_v1_endpoints' ); 20 32 21 33 // Allow some routes to skip the JSON REST API v1 plugin. … … 378 390 } 379 391 } 392 393 /** 394 * Add a deprecation notice to objects in the response 395 * 396 * @param array $response_data 397 * 398 * @return array 399 */ 400 function deprecate_v1_endpoints( $response_data ) { 401 $response_data = array_merge( 402 array( '_WARNING_DEPRECATED' => 'All v1 endpoints have been deprecated, and will be deactivated after 2018-04-01. Please switch to the v2 endpoints by then, in order to ensure that your application continues to function. If you have any questions, join the #meta-wordcamp channel on Slack or email ' . EMAIL_CENTRAL_SUPPORT ), 403 $response_data 404 ); 405 406 return $response_data; 407 }
Note: See TracChangeset
for help on using the changeset viewer.