Make WordPress Core


Ignore:
Timestamp:
11/21/2012 05:44:49 PM (13 years ago)
Author:
nacin
Message:

Remove legacy media uploader bits from custom-header.php and custom-background.php. see #22186, #21390.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/custom-header.php

    r22695 r22778  
    9494        if ( $this->admin_header_callback )
    9595            add_action("admin_head-$page", $this->admin_header_callback, 51);
    96 
    97         if ( isset( $_REQUEST['context'] ) && $_REQUEST['context'] == 'custom-header' ) {
    98             add_filter( 'attachment_fields_to_edit', array( $this, 'attachment_fields_to_edit' ), 10, 2 );
    99             add_filter( 'media_upload_tabs', array( $this, 'filter_upload_tabs' ) );
    100             add_filter( 'media_upload_mime_type_links', '__return_empty_array' );
    101         }
    10296    }
    10397
     
    172166
    173167        if ( ( 1 == $step || 3 == $step ) ) {
    174             add_thickbox();
    175168            wp_enqueue_media();
    176169            wp_enqueue_script( 'custom-header' );
     
    911904
    912905    /**
    913      * Replace default attachment actions with "Set as header" link.
     906     * Unused since 3.5.0.
    914907     *
    915908     * @since 3.4.0
    916909     */
    917     function attachment_fields_to_edit( $form_fields, $post ) {
    918         $form_fields = array();
    919         $href = esc_url(add_query_arg(array(
    920             'page' => 'custom-header',
    921             'step' => 2,
    922             '_wpnonce-custom-header-upload' => wp_create_nonce('custom-header-upload'),
    923             'file' => $post->ID
    924         ), admin_url('themes.php')));
    925 
    926         $form_fields['buttons'] = array( 'tr' => '<tr class="submit"><td></td><td><a data-location="' . $href . '" class="wp-set-header">' . __( 'Set as header' ) . '</a></td></tr>' );
    927         $form_fields['context'] = array( 'input' => 'hidden', 'value' => 'custom-header' );
    928 
     910    function attachment_fields_to_edit( $form_fields ) {
    929911        return $form_fields;
    930912    }
    931913
    932914    /**
    933      * Leave only "Media Library" tab in the uploader window.
     915     * Unused since 3.5.0.
    934916     *
    935917     * @since 3.4.0
    936918     */
    937     function filter_upload_tabs() {
    938         return array( 'library' => __('Media Library') );
     919    function filter_upload_tabs( $tabs ) {
     920        return $tabs;
    939921    }
    940922
Note: See TracChangeset for help on using the changeset viewer.