Skip to content

Commit 08969ec

Browse files
Show a "No themes found" message if the search for an installed theme doesn't produce any results.
props gauravmittal1995 for initial patch. fixes #28587. git-svn-id: https://develop.svn.wordpress.org/trunk@28890 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 665e2c3 commit 08969ec

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/wp-admin/js/theme.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@ themes.Collection = Backbone.Collection.extend({
190190
return match.test( haystack );
191191
});
192192

193+
if ( results.length === 0 ) {
194+
this.trigger( 'query:empty' );
195+
} else {
196+
$( 'body' ).removeClass( 'no-results' );
197+
}
198+
193199
this.reset( results );
194200
},
195201

src/wp-admin/themes.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@
233233
</div>
234234
<div class="theme-overlay"></div>
235235

236+
<p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>
237+
236238
<?php
237239
// List broken themes, if any.
238240
if ( ! is_multisite() && current_user_can('edit_themes') && $broken_themes = wp_get_themes( array( 'errors' => true ) ) ) {

0 commit comments

Comments
 (0)