Changeset 9668
- Timestamp:
- 04/01/2020 03:03:01 AM (5 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content
- Files:
-
- 3 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; -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php
r9543 r9668 88 88 89 89 if ( ! is_404() ) { 90 wp_enqueue_script( 'wporg-plugins-locale-banner', get_stylesheet_directory_uri() . '/js/locale-banner.js', array( 'jquery' ), '20 181209', true );90 wp_enqueue_script( 'wporg-plugins-locale-banner', get_stylesheet_directory_uri() . '/js/locale-banner.js', array( 'jquery' ), '20200401', true ); 91 91 wp_localize_script( 'wporg-plugins-locale-banner', 'wporgLocaleBanner', array( 92 92 'apiURL' => rest_url( '/plugins/v1/locale-banner' ), -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/js/locale-banner.js
r7962 r9668 7 7 8 8 $.ajax( { 9 type: ' POST',9 type: 'GET', 10 10 url: wporgLocaleBanner.apiURL, 11 11 dataType: 'json',
Note: See TracChangeset
for help on using the changeset viewer.