Attach Media: Display the correct error message when search result is empty.

fixes #29093.

git-svn-id: https://develop.svn.wordpress.org/trunk@29356 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2014-08-02 14:23:42 +00:00
parent de7962c947
commit ee91f3f94f
1 changed files with 3 additions and 2 deletions

View File

@ -1637,8 +1637,9 @@ function wp_ajax_find_posts() {
$posts = get_posts( $args );
if ( ! $posts )
wp_die( __('No items found.') );
if ( ! $posts ) {
wp_send_json_error( __( 'No items found.' ) );
}
$html = '<table class="widefat"><thead><tr><th class="found-radio"><br /></th><th>'.__('Title').'</th><th class="no-break">'.__('Type').'</th><th class="no-break">'.__('Date').'</th><th class="no-break">'.__('Status').'</th></tr></thead><tbody>';
$alt = '';