From 608d505b246ca0261555f8a0c51798e791f7c809 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Sat, 2 Aug 2014 14:24:15 +0000 Subject: [PATCH] Attach Media: Display the correct error message when search result is empty. fixes #29093. Built from https://develop.svn.wordpress.org/trunk@29356 git-svn-id: http://core.svn.wordpress.org/trunk@29132 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/ajax-actions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 0e7394f5c8..b87fec4343 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -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 = ''; $alt = '';

'.__('Title').''.__('Type').''.__('Date').''.__('Status').'