Make WordPress Core

Changeset 22778


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

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

Location:
trunk/wp-admin
Files:
2 edited

Legend:

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

    r22521 r22778  
    7373        add_action("load-$page", array(&$this, 'take_action'), 49);
    7474        add_action("load-$page", array(&$this, 'handle_upload'), 49);
    75 
    76         if ( isset( $_REQUEST['context'] ) && $_REQUEST['context'] == 'custom-background' ) {
    77             add_filter( 'attachment_fields_to_edit', array( $this, 'attachment_fields_to_edit' ), 10, 2 );
    78             add_filter( 'media_upload_tabs', array( $this, 'filter_upload_tabs' ) );
    79             add_filter( 'media_upload_mime_type_links', '__return_empty_array' );
    80         }
    8175
    8276        if ( $this->admin_header_callback )
     
    106100        );
    107101
    108         add_thickbox();
    109102        wp_enqueue_media();
    110103        wp_enqueue_script('custom-background');
     
    398391
    399392    /**
    400      * Replace default attachment actions with "Set as background" link.
     393     * Unused since 3.5.0.
    401394     *
    402395     * @since 3.4.0
    403396     */
    404     function attachment_fields_to_edit( $form_fields, $post ) {
    405         $form_fields = array( 'image-size' => $form_fields['image-size'] );
    406         $form_fields['buttons'] = array( 'tr' => '<tr class="submit"><td></td><td><a data-attachment-id="' . $post->ID . '" class="wp-set-background">' . __( 'Set as background' ) . '</a></td></tr>' );
    407         $form_fields['context'] = array( 'input' => 'hidden', 'value' => 'custom-background' );
    408 
     397    function attachment_fields_to_edit( $form_fields ) {
    409398        return $form_fields;
    410399    }
    411400
    412401    /**
    413      * Leave only "Media Library" tab in the uploader window.
     402     * Unused since 3.5.0.
    414403     *
    415404     * @since 3.4.0
    416405     */
    417     function filter_upload_tabs() {
    418         return array( 'library' => __('Media Library') );
     406    function filter_upload_tabs( $tabs ) {
     407        return $tabs;
    419408    }
    420409
  • 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.