mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-18 12:35:03 +00:00
Theme install: Set a timeout and error message for API responses.
props ocean90. fixes #27708. Built from https://develop.svn.wordpress.org/trunk@28105 git-svn-id: http://core.svn.wordpress.org/trunk@27936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6fc0120e20
commit
cd5f8d517c
@ -325,6 +325,7 @@ themes.Collection = Backbone.Collection.extend({
|
|||||||
return $.ajax({
|
return $.ajax({
|
||||||
url: 'https://api.wordpress.org/themes/info/1.1/?callback=?',
|
url: 'https://api.wordpress.org/themes/info/1.1/?callback=?',
|
||||||
dataType: 'jsonp',
|
dataType: 'jsonp',
|
||||||
|
timeout: 15000, // 15 seconds
|
||||||
|
|
||||||
// Request data
|
// Request data
|
||||||
data: {
|
data: {
|
||||||
|
2
wp-admin/js/theme.min.js
vendored
2
wp-admin/js/theme.min.js
vendored
File diff suppressed because one or more lines are too long
@ -56,7 +56,7 @@ wp_localize_script( 'theme', '_wpThemeSettings', array(
|
|||||||
'searchPlaceholder' => __( 'Search themes...' ), // placeholder (no ellipsis)
|
'searchPlaceholder' => __( 'Search themes...' ), // placeholder (no ellipsis)
|
||||||
'upload' => __( 'Upload Theme' ),
|
'upload' => __( 'Upload Theme' ),
|
||||||
'back' => __( 'Back' ),
|
'back' => __( 'Back' ),
|
||||||
'error' => ( 'There was a problem trying to load the themes. Please, try again.' ), // @todo improve
|
'error' => sprintf( __( 'An unexpected error occurred and we can᾿t reach WordPress.org. If you continue to have problems, please try the <a href="%s">support forums</a>.' ), __( 'https://wordpress.org/support/' ) )
|
||||||
),
|
),
|
||||||
'installedThemes' => array_keys( $installed_themes ),
|
'installedThemes' => array_keys( $installed_themes ),
|
||||||
'browse' => array(
|
'browse' => array(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user