Display error message when Media Library upload fails.

Props gcorne.
Fixes #29891.

Built from https://develop.svn.wordpress.org/trunk@30156


git-svn-id: http://core.svn.wordpress.org/trunk@30156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-11-01 20:25:23 +00:00
parent be08f576df
commit 60b73c589c
2 changed files with 3 additions and 2 deletions

View File

@ -35,8 +35,9 @@ function check_upload_size( $file ) {
if ( upload_is_user_over_quota( false ) ) { if ( upload_is_user_over_quota( false ) ) {
$file['error'] = __( 'You have used your space quota. Please delete files before uploading.' ); $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>' ); wp_die( $file['error'] . ' <a href="javascript:history.go(-1)">' . __( 'Back' ) . '</a>' );
}
return $file; return $file;
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.1-alpha-30155'; $wp_version = '4.1-alpha-30156';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.