diff --git a/src/wp-admin/includes/class-wp-plugin-install-list-table.php b/src/wp-admin/includes/class-wp-plugin-install-list-table.php index 46eca16143..39442a6034 100644 --- a/src/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/src/wp-admin/includes/class-wp-plugin-install-list-table.php @@ -230,11 +230,10 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { */ public function no_items() { if ( isset( $this->error ) ) { - $message = $this->error->get_error_message() . '

' . __( 'Try again' ) . '

'; + echo '

' . $this->error->get_error_message() . '

'; } else { - $message = __( 'No plugins match your request.' ); + echo '
' . __( 'No plugins found. Try a different search query.' ) . '
'; } - echo '
' . $message . '
'; } /** diff --git a/src/wp-admin/js/theme.js b/src/wp-admin/js/theme.js index e91c0d16b7..cd0af3b593 100644 --- a/src/wp-admin/js/theme.js +++ b/src/wp-admin/js/theme.js @@ -1603,7 +1603,11 @@ themes.view.Installer = themes.view.Appearance.extend({ this.listenTo( this.collection, 'query:fail', function() { $( 'body' ).removeClass( 'loading-content' ); $( '.theme-browser' ).find( 'div.error' ).remove(); - $( '.theme-browser' ).find( 'div.themes' ).before( '

' + l10n.error + '

' ); + $( '.theme-browser' ).find( 'div.themes' ).before( '

' + l10n.error + '

' ); + $( '.theme-browser .error .try-again' ).on( 'click', function( e ) { + e.preventDefault(); + $( 'input.wp-filter-search' ).trigger( 'input' ); + } ); }); if ( this.view ) { diff --git a/src/wp-admin/js/updates.js b/src/wp-admin/js/updates.js index 4f1bfbbdc2..45911870f1 100644 --- a/src/wp-admin/js/updates.js +++ b/src/wp-admin/js/updates.js @@ -2291,6 +2291,16 @@ $( 'input.wp-filter-search' ).trigger( 'input' ); } ); + /** + * Trigger a search event when the "Try Again" button is clicked. + * + * @since 4.8.0 + */ + $document.on( 'click', '.try-again', function( event ) { + event.preventDefault(); + $pluginInstallSearch.trigger( 'input' ); + } ); + /** * Trigger a search event when the search type gets changed. * diff --git a/src/wp-admin/theme-install.php b/src/wp-admin/theme-install.php index 90641c12a2..aea7e4489a 100644 --- a/src/wp-admin/theme-install.php +++ b/src/wp-admin/theme-install.php @@ -58,8 +58,9 @@ wp_localize_script( 'theme', '_wpThemeSettings', array( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums.' ), __( 'https://wordpress.org/support/' ) ), + 'tryAgain' => __( 'Try Again' ), 'themesFound' => __( 'Number of Themes found: %d' ), - 'noThemesFound' => __( 'No themes found. Try a different search.' ), + 'noThemesFound' => __( 'No themes found. Try a different search query.' ), 'collapseSidebar' => __( 'Collapse Sidebar' ), 'expandSidebar' => __( 'Expand Sidebar' ), /* translators: accessibility text */ @@ -227,7 +228,7 @@ include(ABSPATH . 'wp-admin/admin-header.php');
-

+

__( 'Search Installed Themes' ), 'searchPlaceholder' => __( 'Search installed themes...' ), // placeholder (no ellipsis) 'themesFound' => __( 'Number of Themes found: %d' ), - 'noThemesFound' => __( 'No themes found. Try a different search.' ), + 'noThemesFound' => __( 'No themes found. Try a different search query.' ), ), ) ); @@ -303,7 +303,7 @@ foreach ( $themes as $theme ) :
-

+

__( 'Connection lost or the server is busy. Please try again later.' ), 'nonceError' => __( 'An error has occurred. Please reload the page and try again.' ), 'pluginsFound' => __( 'Number of plugins found: %d' ), - 'noPluginsFound' => __( 'No plugins found. Try a different search.' ), + 'noPluginsFound' => __( 'No plugins found. Try a different search query.' ), ), ) );