Display error message when Media Library upload fails.

Props gcorne.
Fixes #29891.


git-svn-id: https://develop.svn.wordpress.org/trunk@30156 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-11-01 20:24:13 +00:00
parent c8acddfdc8
commit bdf71f89ad
1 changed files with 2 additions and 1 deletions

View File

@ -35,8 +35,9 @@ function check_upload_size( $file ) {
if ( upload_is_user_over_quota( false ) ) {
$file['error'] = __( 'You have used your space quota. Please delete files before uploading.' );
}
if ( $file['error'] != '0' && !isset($_POST['html-upload']) )
if ( $file['error'] != '0' && ! isset( $_POST['html-upload'] ) && ( ! defined( 'DOING_AJAX' ) || DOING_AJAX != true ) ) {
wp_die( $file['error'] . ' <a href="javascript:history.go(-1)">' . __( 'Back' ) . '</a>' );
}
return $file;
}