]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/media-new.php
Wordpress 4.5.3-scripts
[autoinstalls/wordpress.git] / wp-admin / media-new.php
index c6a7ae141584e2df823d9e0ee64199c59a0975ef..9d26651e85546b9c6ae70e0aea7b26ee4e8846ca 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 /** Load WordPress Administration Bootstrap */
  */
 
 /** Load WordPress Administration Bootstrap */
-require_once('./admin.php');
+require_once( dirname( __FILE__ ) . '/admin.php' );
 
 if (!current_user_can('upload_files'))
        wp_die(__('You do not have permission to upload files.'));
 
 if (!current_user_can('upload_files'))
        wp_die(__('You do not have permission to upload files.'));
@@ -25,15 +25,15 @@ if ( isset( $_REQUEST['post_id'] ) ) {
 }
 
 if ( $_POST ) {
 }
 
 if ( $_POST ) {
-       $location = 'upload.php';
        if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
                check_admin_referer('media-form');
                // Upload File button was clicked
        if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
                check_admin_referer('media-form');
                // Upload File button was clicked
-               $id = media_handle_upload( 'async-upload', $post_id );
-               if ( is_wp_error( $id ) )
-                       $location .= '?message=3';
+               $upload_id = media_handle_upload( 'async-upload', $post_id );
+               if ( is_wp_error( $upload_id ) ) {
+                       wp_die( $upload_id );
+               }
        }
        }
-       wp_redirect( admin_url( $location ) );
+       wp_redirect( admin_url( 'upload.php' ) );
        exit;
 }
 
        exit;
 }
 
@@ -53,8 +53,8 @@ get_current_screen()->add_help_tab( array(
 ) );
 get_current_screen()->set_help_sidebar(
        '<p><strong>' . __('For more information:') . '</strong></p>' .
 ) );
 get_current_screen()->set_help_sidebar(
        '<p><strong>' . __('For more information:') . '</strong></p>' .
-       '<p>' . __('<a href="http://codex.wordpress.org/Media_Add_New_Screen" target="_blank">Documentation on Uploading Media Files</a>') . '</p>' .
-       '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+       '<p>' . __('<a href="https://codex.wordpress.org/Media_Add_New_Screen" target="_blank">Documentation on Uploading Media Files</a>') . '</p>' .
+       '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
 );
 
 require_once( ABSPATH . 'wp-admin/admin-header.php' );
 );
 
 require_once( ABSPATH . 'wp-admin/admin-header.php' );
@@ -65,10 +65,9 @@ if ( get_user_setting('uploader') || isset( $_GET['browser-uploader'] ) )
        $form_class .= ' html-uploader';
 ?>
 <div class="wrap">
        $form_class .= ' html-uploader';
 ?>
 <div class="wrap">
-       <?php screen_icon(); ?>
-       <h2><?php echo esc_html( $title ); ?></h2>
+       <h1><?php echo esc_html( $title ); ?></h1>
 
 
-       <form enctype="multipart/form-data" method="post" action="<?php echo admin_url('media-new.php'); ?>" class="<?php echo $form_class; ?>" id="file-form">
+       <form enctype="multipart/form-data" method="post" action="<?php echo admin_url('media-new.php'); ?>" class="<?php echo esc_attr( $form_class ); ?>" id="file-form">
 
        <?php media_upload_form(); ?>
 
 
        <?php media_upload_form(); ?>