Make WordPress Core


Ignore:
Timestamp:
11/21/2012 12:19:40 PM (14 years ago)
Author:
nacin
Message:

Split media-new.php and media-upload.php into distinct files.

  • media-new.php will remain the entry point for uploading isolated files, and for using the browser-based uploader (versus Plupload).
  • media-upload.php is the legacy (pre-3.5) media uploader.

see #22083.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/media-new.php

    r22746 r22751  
    99 * @subpackage Administration
    1010 */
    11 
    12 if ( ! isset( $_GET['inline'] ) )
    13         define( 'IFRAME_REQUEST' , true );
    1411
    1512/** Load WordPress Administration Bootstrap */
    … …  
    2522wp_enqueue_script( 'media-gallery' );
    2623
    27 @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
    2824
    2925// IDs should be integers
    … …  
    3531        wp_die( __( 'Cheatin’ uh?' ) );
    3632
    37 if ( isset($_GET['inline']) ) {
    3833        $errors = array();
    3934
    … …  
    9792        <h2><?php echo esc_html( $title ); ?></h2>
    9893
    99         <form enctype="multipart/form-data" method="post" action="<?php echo admin_url('media-upload.php?inline=&amp;upload-page-form='); ?>" class="<?php echo $form_class; ?>" id="file-form">
     94        <form enctype="multipart/form-data" method="post" action="<?php echo admin_url('media-new.php?inline=&amp;upload-page-form='); ?>" class="<?php echo $form_class; ?>" id="file-form">
    10095
    10196        <?php media_upload_form(); ?>
    … …  
    121116<?php
    122117        include('./admin-footer.php');
    123 
    124 } else {
    125         if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post' , $_REQUEST['post_id'] ) )
    126                 wp_die( __( 'Cheatin&#8217; uh?' ) );
    127 
    128         // upload type: image, video, file, ..?
    129         if ( isset($_GET['type']) )
    130                 $type = strval($_GET['type']);
    131         else
    132                 $type = apply_filters('media_upload_default_type', 'file');
    133 
    134         // tab: gallery, library, or type-specific
    135         if ( isset($_GET['tab']) )
    136                 $tab = strval($_GET['tab']);
    137         else
    138                 $tab = apply_filters('media_upload_default_tab', 'type');
    139 
    140         $body_id = 'media-upload';
    141 
    142         // let the action code decide how to handle the request
    143         if ( $tab == 'type' || $tab == 'type_url' || ! array_key_exists( $tab , media_upload_tabs() ) )
    144                 do_action("media_upload_$type");
    145         else
    146                 do_action("media_upload_$tab");
    147 }
Note: See TracChangeset for help on using the changeset viewer.