Changeset 9668 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-locale-banner.php
- Timestamp:
- 04/01/2020 03:03:01 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-locale-banner.php
r9667 r9668 14 14 function __construct() { 15 15 register_rest_route( 'plugins/v1', '/locale-banner', array( 16 'methods' => WP_REST_Server:: EDITABLE,16 'methods' => WP_REST_Server::ALLMETHODS, 17 17 'callback' => array( $this, 'locale_banner' ), 18 18 'args' => array( … … 210 210 } 211 211 212 $result = [212 $result = new \WP_REST_Response( [ 213 213 'suggest_string' => $suggest_string, 214 214 'translated' => $translated_locales, 215 ]; 215 ] ); 216 217 // Allow this API to be cached, varied by Accept-Language header. 218 $result->header( 'Vary', 'Accept-Language' ); 219 $result->header( 'Expires', gmdate( 'r', time() + 3600 ) ); 220 $result->header( 'Cache-Control', 'max-age=3600' ); 216 221 217 222 return $result;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)