Don't lose upload error messages. Props filosofo. fixes #10238 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@11638 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a7db9e2ac1
commit
ce546f6edd
@ -380,7 +380,7 @@ add_action( 'media_buttons', 'media_buttons' );
|
|||||||
function media_upload_form_handler() {
|
function media_upload_form_handler() {
|
||||||
check_admin_referer('media-form');
|
check_admin_referer('media-form');
|
||||||
|
|
||||||
$errors = array();
|
$errors = null;
|
||||||
|
|
||||||
if ( isset($_POST['send']) ) {
|
if ( isset($_POST['send']) ) {
|
||||||
$keys = array_keys($_POST['send']);
|
$keys = array_keys($_POST['send']);
|
||||||
|
@ -29,16 +29,7 @@ if ( isset($action) && $action == 'edit' && !$ID )
|
|||||||
wp_die(__("You are not allowed to be here"));
|
wp_die(__("You are not allowed to be here"));
|
||||||
|
|
||||||
if ( isset($_GET['inline']) ) {
|
if ( isset($_GET['inline']) ) {
|
||||||
|
$errors = array();
|
||||||
if ( isset($_GET['upload-page-form']) ) {
|
|
||||||
$errors = media_upload_form_handler();
|
|
||||||
|
|
||||||
$location = 'upload.php';
|
|
||||||
if ( $errors )
|
|
||||||
$location .= '?message=3';
|
|
||||||
|
|
||||||
wp_redirect( admin_url($location) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
|
if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
|
||||||
// Upload File button was clicked
|
// Upload File button was clicked
|
||||||
@ -50,6 +41,16 @@ if ( isset($_GET['inline']) ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( isset($_GET['upload-page-form']) ) {
|
||||||
|
$errors = array_merge($errors, (array) media_upload_form_handler());
|
||||||
|
|
||||||
|
$location = 'upload.php';
|
||||||
|
if ( $errors )
|
||||||
|
$location .= '?message=3';
|
||||||
|
|
||||||
|
wp_redirect( admin_url($location) );
|
||||||
|
}
|
||||||
|
|
||||||
$title = __('Upload New Media');
|
$title = __('Upload New Media');
|
||||||
$parent_file = 'upload.php';
|
$parent_file = 'upload.php';
|
||||||
require_once('admin-header.php'); ?>
|
require_once('admin-header.php'); ?>
|
||||||
|
Loading…
Reference in New Issue
Block a user